@justanarthur/modo-ui 0.6.0-canary.9 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (619) hide show
  1. package/README.md +197 -643
  2. package/blocks/sidebar-app/examples.mdx +2 -2
  3. package/blocks/sidebar-app/index.tsx +20 -7
  4. package/blocks/sidebar-app/inset-topbar.tsx +3 -8
  5. package/blocks/sidebar-app/menu-grid.ts +8 -18
  6. package/blocks/sidebar-app/nav-data.ts +1 -1
  7. package/blocks/sidebar-app/search-field.tsx +8 -15
  8. package/blocks/sidebar-app/thread-page.tsx +58 -0
  9. package/blocks/sidebar-app/user-footer.tsx +8 -15
  10. package/blocks/sidebar-app/workspace-header.tsx +9 -28
  11. package/components/AI/input-message/examples.mdx +37 -33
  12. package/components/AI/input-message/file-preview-tile.tsx +59 -0
  13. package/components/AI/input-message/file-thumbnail.tsx +26 -53
  14. package/components/AI/input-message/index.tsx +362 -1122
  15. package/components/AI/input-message/input-message.css +25 -0
  16. package/components/AI/input-message/queued-row.tsx +102 -0
  17. package/components/AI/input-message/shared.ts +38 -0
  18. package/components/AI/input-message/suggestion-row.tsx +64 -0
  19. package/components/AI/input-message/use-composer-files.ts +142 -0
  20. package/components/AI/input-message/use-history-nav.ts +60 -0
  21. package/components/AI/input-message/use-message-queue.ts +108 -0
  22. package/components/AI/input-message/use-region-height.ts +34 -0
  23. package/components/AI/thinking-indicator/index.tsx +9 -31
  24. package/components/accordion/accordion-content.tsx +217 -0
  25. package/components/accordion/accordion-context.tsx +118 -0
  26. package/components/accordion/accordion-group.tsx +215 -0
  27. package/components/accordion/examples.mdx +64 -132
  28. package/components/accordion/index.tsx +127 -891
  29. package/components/avatar/examples.mdx +2 -2
  30. package/components/avatar/index.tsx +40 -34
  31. package/components/badge/change-demo.tsx +2 -0
  32. package/components/badge/examples.mdx +16 -34
  33. package/components/badge/index.tsx +31 -69
  34. package/components/badge/variants.ts +5 -30
  35. package/components/button/examples.mdx +79 -94
  36. package/components/button/index.tsx +97 -188
  37. package/components/button/loading-demo.tsx +2 -0
  38. package/components/button/variants.ts +12 -117
  39. package/components/card/card-group.tsx +184 -0
  40. package/components/card/card-media.tsx +207 -0
  41. package/components/card/card-parts.tsx +179 -0
  42. package/components/card/examples.mdx +91 -143
  43. package/components/card/index.tsx +190 -881
  44. package/components/copy/examples.mdx +29 -67
  45. package/components/copy/index.tsx +58 -285
  46. package/components/inputs/checkbox/examples.mdx +22 -39
  47. package/components/inputs/checkbox/index.tsx +103 -255
  48. package/components/inputs/checkbox/select-all-demo.tsx +8 -6
  49. package/components/inputs/color-picker/channel-sliders.tsx +70 -0
  50. package/components/inputs/color-picker/color-input.tsx +387 -0
  51. package/components/inputs/color-picker/{variants.ts → color-math.ts} +22 -57
  52. package/components/inputs/color-picker/context.ts +11 -0
  53. package/components/inputs/color-picker/examples.mdx +20 -59
  54. package/components/inputs/color-picker/format-menu.tsx +212 -0
  55. package/components/inputs/color-picker/index.tsx +190 -1776
  56. package/components/inputs/color-picker/inputs-row.tsx +196 -0
  57. package/components/inputs/color-picker/popover.tsx +161 -0
  58. package/components/inputs/color-picker/saturation-square.tsx +167 -0
  59. package/components/inputs/color-picker/swatches.tsx +178 -0
  60. package/components/inputs/combobox/context.ts +90 -0
  61. package/components/inputs/combobox/examples.mdx +103 -206
  62. package/components/inputs/combobox/fields.tsx +328 -0
  63. package/components/inputs/combobox/index.tsx +155 -1310
  64. package/components/inputs/combobox/list.tsx +415 -0
  65. package/components/inputs/combobox/remote-demo.tsx +70 -74
  66. package/components/inputs/date-time/calendar/examples.mdx +0 -11
  67. package/components/inputs/date-time/calendar/index.tsx +32 -59
  68. package/components/inputs/date-time/calendar/use-month-window.ts +35 -32
  69. package/components/inputs/date-time/date-picker/examples.mdx +59 -155
  70. package/components/inputs/date-time/date-picker/index.tsx +186 -370
  71. package/components/inputs/date-time/date-picker/masked-date-input.tsx +105 -247
  72. package/components/inputs/date-time/date-range-picker/examples.mdx +6 -62
  73. package/components/inputs/date-time/date-range-picker/index.tsx +105 -404
  74. package/components/inputs/date-time/date-value.ts +37 -0
  75. package/components/inputs/date-time/day-rules.ts +22 -0
  76. package/components/inputs/date-time/duration-picker/examples.mdx +0 -24
  77. package/components/inputs/date-time/duration-picker/index.tsx +50 -140
  78. package/components/inputs/date-time/month-picker/examples.mdx +0 -29
  79. package/components/inputs/date-time/month-picker/index.tsx +48 -132
  80. package/components/inputs/date-time/picker-shell.tsx +226 -347
  81. package/components/inputs/date-time/time-columns.tsx +11 -15
  82. package/components/inputs/date-time/time-picker/examples.mdx +0 -31
  83. package/components/inputs/date-time/time-picker/index.tsx +37 -118
  84. package/components/inputs/field/examples.mdx +81 -39
  85. package/components/inputs/field/index.tsx +113 -103
  86. package/components/inputs/file-dropzone/examples.mdx +23 -24
  87. package/components/inputs/file-dropzone/file-row.tsx +20 -21
  88. package/components/inputs/file-dropzone/index.tsx +130 -129
  89. package/components/inputs/file-dropzone/upload-demo.tsx +22 -18
  90. package/components/inputs/file-dropzone/variants.ts +3 -1
  91. package/components/inputs/input/examples.mdx +19 -74
  92. package/components/inputs/input/index.tsx +86 -149
  93. package/components/inputs/input/password-demo.tsx +5 -5
  94. package/components/inputs/label/examples.mdx +19 -26
  95. package/components/inputs/label/index.tsx +21 -34
  96. package/components/inputs/number-input/examples.mdx +63 -36
  97. package/components/inputs/number-input/index.tsx +62 -57
  98. package/components/inputs/radio/examples.mdx +24 -39
  99. package/components/inputs/radio/index.tsx +125 -328
  100. package/components/inputs/search/examples.mdx +3 -3
  101. package/components/inputs/search/index.tsx +46 -39
  102. package/components/inputs/select/examples.mdx +76 -167
  103. package/components/inputs/select/index.tsx +252 -776
  104. package/components/inputs/slider/comfortable.tsx +524 -0
  105. package/components/inputs/slider/compact.tsx +690 -0
  106. package/components/inputs/slider/examples.mdx +9 -35
  107. package/components/inputs/slider/geometry.ts +88 -0
  108. package/components/inputs/slider/index.tsx +65 -1796
  109. package/components/inputs/slider/value-display.tsx +184 -0
  110. package/components/inputs/switch/examples.mdx +31 -33
  111. package/components/inputs/switch/index.tsx +55 -107
  112. package/components/inputs/textarea/examples.mdx +23 -61
  113. package/components/inputs/textarea/index.tsx +21 -99
  114. package/components/navigation/navigation-menu/content.tsx +76 -0
  115. package/components/navigation/navigation-menu/context.ts +34 -0
  116. package/components/navigation/navigation-menu/examples.mdx +21 -84
  117. package/components/navigation/navigation-menu/index.tsx +139 -639
  118. package/components/navigation/navigation-menu/item.tsx +47 -0
  119. package/components/navigation/navigation-menu/link.tsx +104 -0
  120. package/components/navigation/navigation-menu/list.tsx +86 -0
  121. package/components/navigation/navigation-menu/trigger.tsx +78 -0
  122. package/components/navigation/navigation-menu/use-dom-rows.ts +56 -0
  123. package/components/navigation/pagination/examples.mdx +25 -34
  124. package/components/navigation/pagination/index.tsx +75 -153
  125. package/components/navigation/sidebar/examples.mdx +17 -23
  126. package/components/navigation/sidebar/index.tsx +59 -119
  127. package/components/navigation/sidebar/menu-scope.tsx +439 -0
  128. package/components/navigation/sidebar/row-label.tsx +61 -0
  129. package/components/navigation/sidebar/sidebar-context.tsx +71 -0
  130. package/components/navigation/sidebar/sidebar-group.tsx +299 -0
  131. package/components/navigation/sidebar/sidebar-menu-actions.tsx +209 -0
  132. package/components/navigation/sidebar/sidebar-menu-button.tsx +214 -0
  133. package/components/navigation/sidebar/sidebar-menu-item.tsx +207 -0
  134. package/components/navigation/sidebar/sidebar-menu-sub.tsx +180 -0
  135. package/components/navigation/sidebar/sidebar-parts.tsx +94 -0
  136. package/components/navigation/sidebar/sidebar-provider.tsx +248 -0
  137. package/components/navigation/sidebar/sidebar-rail.tsx +206 -0
  138. package/components/navigation/sidebar/sidebar-shell.tsx +180 -0
  139. package/components/navigation/sidebar/sidebar-shortcut.tsx +101 -0
  140. package/components/navigation/sidebar/sidebar.css +7 -11
  141. package/components/navigation/sidebar/use-measured-collapse.ts +62 -0
  142. package/components/navigation/tabs/context.ts +45 -0
  143. package/components/navigation/tabs/examples.mdx +63 -17
  144. package/components/navigation/tabs/index.tsx +82 -434
  145. package/components/navigation/tabs/item.tsx +161 -0
  146. package/components/navigation/tabs/list.tsx +143 -0
  147. package/components/overlays/alert-dialog/examples.mdx +2 -36
  148. package/components/overlays/alert-dialog/index.tsx +76 -90
  149. package/components/overlays/alert-dialog/pending-demo.tsx +3 -1
  150. package/components/overlays/command/index.tsx +28 -59
  151. package/components/overlays/context-menu/examples.mdx +58 -4
  152. package/components/overlays/context-menu/index.tsx +77 -221
  153. package/components/overlays/dialog/examples.mdx +8 -31
  154. package/components/overlays/dialog/index.tsx +81 -261
  155. package/components/overlays/dropdown/dropdown-search.tsx +33 -98
  156. package/components/overlays/dropdown/examples.mdx +77 -363
  157. package/components/overlays/dropdown/index.tsx +114 -1010
  158. package/components/overlays/dropdown/menu-item.tsx +98 -382
  159. package/components/overlays/dropdown/menu-popup.tsx +294 -0
  160. package/components/overlays/dropdown/panel-state.ts +176 -0
  161. package/components/overlays/dropdown/submenu.tsx +170 -0
  162. package/components/overlays/popover/anchored-demo.tsx +22 -13
  163. package/components/overlays/popover/examples.mdx +16 -65
  164. package/components/overlays/popover/index.tsx +93 -137
  165. package/components/overlays/preview-card/examples.mdx +4 -4
  166. package/components/overlays/preview-card/index.tsx +48 -103
  167. package/components/overlays/sheet/examples.mdx +0 -12
  168. package/components/overlays/sheet/index.tsx +44 -129
  169. package/components/overlays/toast/examples.mdx +33 -25
  170. package/components/overlays/toast/index.tsx +56 -203
  171. package/components/overlays/toast/manager.ts +63 -119
  172. package/components/overlays/tooltip/examples.mdx +6 -12
  173. package/components/overlays/tooltip/index.tsx +124 -264
  174. package/components/progress/index.tsx +24 -30
  175. package/components/progress/progress.css +6 -28
  176. package/components/progress/step-demo.tsx +2 -0
  177. package/components/table/context.ts +49 -0
  178. package/components/table/examples.mdx +40 -72
  179. package/components/table/head.tsx +105 -0
  180. package/components/table/index.tsx +73 -458
  181. package/components/table/parts.tsx +188 -0
  182. package/components/table/sort-demo.tsx +21 -30
  183. package/dist/base.css +141 -122
  184. package/dist/blocks/sidebar-app/index.d.ts +10 -2
  185. package/dist/blocks/sidebar-app/index.js +49 -40
  186. package/dist/components/AI/input-message/index.d.ts +22 -19
  187. package/dist/components/AI/input-message/index.js +30 -23
  188. package/dist/components/AI/thinking-indicator/index.d.ts +2 -0
  189. package/dist/components/AI/thinking-indicator/index.js +10 -9
  190. package/dist/components/accordion/index.d.ts +52 -85
  191. package/dist/components/accordion/index.js +25 -19
  192. package/dist/components/avatar/index.d.ts +10 -10
  193. package/dist/components/avatar/index.js +9 -8
  194. package/dist/components/badge/index.d.ts +11 -18
  195. package/dist/components/badge/index.js +9 -9
  196. package/dist/components/badge/variants.d.ts +2 -9
  197. package/dist/components/badge/variants.js +3 -5
  198. package/dist/components/button/index.d.ts +36 -60
  199. package/dist/components/button/index.js +12 -9
  200. package/dist/components/button/variants.d.ts +3 -34
  201. package/dist/components/button/variants.js +2 -4
  202. package/dist/components/card/index.d.ts +163 -108
  203. package/dist/components/card/index.js +30 -21
  204. package/dist/components/copy/index.d.ts +10 -41
  205. package/dist/components/copy/index.js +18 -15
  206. package/dist/components/inputs/checkbox/index.d.ts +25 -25
  207. package/dist/components/inputs/checkbox/index.js +22 -18
  208. package/dist/components/inputs/color-picker/index.d.ts +65 -53
  209. package/dist/components/inputs/color-picker/index.js +35 -29
  210. package/dist/components/inputs/combobox/index.d.ts +147 -152
  211. package/dist/components/inputs/combobox/index.js +31 -29
  212. package/dist/components/inputs/date-time/calendar/index.d.ts +18 -24
  213. package/dist/components/inputs/date-time/calendar/index.js +17 -15
  214. package/dist/components/inputs/date-time/date-picker/index.d.ts +52 -96
  215. package/dist/components/inputs/date-time/date-picker/index.js +42 -35
  216. package/dist/components/inputs/date-time/date-range-picker/index.d.ts +48 -108
  217. package/dist/components/inputs/date-time/date-range-picker/index.js +40 -35
  218. package/dist/components/inputs/date-time/duration-picker/index.d.ts +21 -67
  219. package/dist/components/inputs/date-time/duration-picker/index.js +39 -33
  220. package/dist/components/inputs/date-time/month-picker/index.d.ts +18 -61
  221. package/dist/components/inputs/date-time/month-picker/index.js +38 -32
  222. package/dist/components/inputs/date-time/time-picker/index.d.ts +18 -59
  223. package/dist/components/inputs/date-time/time-picker/index.js +39 -33
  224. package/dist/components/inputs/field/index.d.ts +37 -41
  225. package/dist/components/inputs/field/index.js +13 -14
  226. package/dist/components/inputs/file-dropzone/index.d.ts +32 -25
  227. package/dist/components/inputs/file-dropzone/index.js +18 -15
  228. package/dist/components/inputs/file-dropzone/variants.js +1 -1
  229. package/dist/components/inputs/input/index.d.ts +48 -50
  230. package/dist/components/inputs/input/index.js +14 -12
  231. package/dist/components/inputs/label/index.d.ts +12 -10
  232. package/dist/components/inputs/label/index.js +5 -4
  233. package/dist/components/inputs/number-input/index.d.ts +31 -23
  234. package/dist/components/inputs/number-input/index.js +16 -14
  235. package/dist/components/inputs/radio/index.d.ts +20 -16
  236. package/dist/components/inputs/radio/index.js +20 -16
  237. package/dist/components/inputs/search/index.d.ts +12 -5
  238. package/dist/components/inputs/search/index.js +33 -26
  239. package/dist/components/inputs/select/index.d.ts +88 -99
  240. package/dist/components/inputs/select/index.js +32 -29
  241. package/dist/components/inputs/slider/index.d.ts +26 -48
  242. package/dist/components/inputs/slider/index.js +9 -10
  243. package/dist/components/inputs/switch/index.d.ts +12 -6
  244. package/dist/components/inputs/switch/index.js +17 -15
  245. package/dist/components/inputs/textarea/index.d.ts +12 -22
  246. package/dist/components/inputs/textarea/index.js +12 -9
  247. package/dist/components/navigation/navigation-menu/index.d.ts +112 -83
  248. package/dist/components/navigation/navigation-menu/index.js +31 -27
  249. package/dist/components/navigation/pagination/index.d.ts +25 -38
  250. package/dist/components/navigation/pagination/index.js +27 -34
  251. package/dist/components/navigation/sidebar/index.d.ts +236 -230
  252. package/dist/components/navigation/sidebar/index.js +59 -55
  253. package/dist/components/navigation/tabs/index.d.ts +62 -45
  254. package/dist/components/navigation/tabs/index.js +23 -17
  255. package/dist/components/overlays/alert-dialog/index.d.ts +71 -106
  256. package/dist/components/overlays/alert-dialog/index.js +24 -19
  257. package/dist/components/overlays/command/index.d.ts +40 -31
  258. package/dist/components/overlays/command/index.js +31 -25
  259. package/dist/components/overlays/context-menu/index.d.ts +70 -84
  260. package/dist/components/overlays/context-menu/index.js +35 -31
  261. package/dist/components/overlays/dialog/index.d.ts +82 -98
  262. package/dist/components/overlays/dialog/index.js +23 -20
  263. package/dist/components/overlays/dropdown/index.d.ts +191 -357
  264. package/dist/components/overlays/dropdown/index.js +35 -41
  265. package/dist/components/overlays/popover/index.d.ts +81 -52
  266. package/dist/components/overlays/popover/index.js +17 -13
  267. package/dist/components/overlays/preview-card/index.d.ts +52 -26
  268. package/dist/components/overlays/preview-card/index.js +16 -12
  269. package/dist/components/overlays/sheet/index.d.ts +41 -45
  270. package/dist/components/overlays/sheet/index.js +24 -19
  271. package/dist/components/overlays/toast/index.d.ts +73 -183
  272. package/dist/components/overlays/toast/index.js +20 -21
  273. package/dist/components/overlays/tooltip/index.d.ts +80 -118
  274. package/dist/components/overlays/tooltip/index.js +14 -12
  275. package/dist/components/progress/index.d.ts +10 -11
  276. package/dist/components/progress/index.js +7 -6
  277. package/dist/components/table/index.d.ts +72 -71
  278. package/dist/components/table/index.js +18 -16
  279. package/dist/index.d.ts +2575 -3149
  280. package/dist/index.js +186 -202
  281. package/dist/lib/date-locale.d.ts +6 -13
  282. package/dist/lib/date-locale.js +5 -11
  283. package/dist/lib/date-mask.d.ts +41 -0
  284. package/dist/lib/date-mask.js +20 -0
  285. package/dist/lib/field-box.d.ts +114 -0
  286. package/dist/lib/field-box.js +18 -0
  287. package/dist/lib/field-classes.d.ts +15 -119
  288. package/dist/lib/field-classes.js +4 -21
  289. package/dist/lib/fluid-hover-highlight.d.ts +3 -25
  290. package/dist/lib/fluid-hover-highlight.js +8 -13
  291. package/dist/lib/focus-ring.d.ts +16 -10
  292. package/dist/lib/focus-ring.js +6 -6
  293. package/dist/lib/goo-indicator.js +6 -5
  294. package/dist/lib/icon-context.d.ts +2 -8
  295. package/dist/lib/icon-context.js +2 -6
  296. package/dist/lib/merge-refs.d.ts +10 -0
  297. package/dist/lib/merge-refs.js +8 -0
  298. package/dist/lib/morph-layers.d.ts +12 -6
  299. package/dist/lib/morph-layers.js +7 -6
  300. package/dist/lib/morph-part.js +3 -3
  301. package/dist/lib/overlay.d.ts +113 -0
  302. package/dist/lib/overlay.js +21 -0
  303. package/dist/lib/popup-rows.d.ts +101 -0
  304. package/dist/lib/popup-rows.js +25 -0
  305. package/dist/lib/popup-surface.d.ts +92 -0
  306. package/dist/lib/popup-surface.js +17 -0
  307. package/dist/lib/popup.d.ts +17 -1
  308. package/dist/lib/popup.js +4 -1
  309. package/dist/lib/rect.d.ts +16 -0
  310. package/dist/lib/rect.js +12 -0
  311. package/dist/lib/reduced-motion.js +1 -1
  312. package/dist/lib/row-group.d.ts +100 -0
  313. package/dist/lib/row-group.js +12 -0
  314. package/dist/lib/row-index.d.ts +12 -7
  315. package/dist/lib/row-index.js +4 -2
  316. package/dist/lib/scroll-column.d.ts +1 -5
  317. package/dist/lib/scroll-column.js +13 -12
  318. package/dist/lib/shape-classes.d.ts +16 -0
  319. package/dist/lib/shape-classes.js +6 -0
  320. package/dist/lib/shape-context.d.ts +2 -9
  321. package/dist/lib/shape-context.js +3 -7
  322. package/dist/lib/size-context.d.ts +1 -2
  323. package/dist/lib/size-context.js +2 -7
  324. package/dist/lib/size-scale.js +1 -1
  325. package/dist/lib/slot.d.ts +31 -26
  326. package/dist/lib/slot.js +9 -9
  327. package/dist/lib/spinner-glyph.d.ts +7 -0
  328. package/dist/lib/spinner-glyph.js +7 -0
  329. package/dist/lib/springs.d.ts +5 -1
  330. package/dist/lib/springs.js +4 -2
  331. package/dist/lib/surface-classes.js +1 -1
  332. package/dist/lib/surface-context.d.ts +3 -1
  333. package/dist/lib/surface-context.js +3 -1
  334. package/dist/lib/use-autosize-textarea.d.ts +16 -0
  335. package/dist/lib/use-autosize-textarea.js +7 -0
  336. package/dist/lib/use-controllable-state.d.ts +15 -1
  337. package/dist/lib/use-controllable-state.js +1 -1
  338. package/dist/lib/use-fluid-hover.d.ts +1 -49
  339. package/dist/lib/use-fluid-hover.js +1 -7
  340. package/dist/lib/use-is-mobile.js +1 -1
  341. package/dist/lib/use-iso-layout-effect.d.ts +7 -0
  342. package/dist/lib/use-iso-layout-effect.js +6 -0
  343. package/dist/lib/use-keyboard-nav-gate.js +3 -2
  344. package/dist/lib/use-merge-split.js +7 -6
  345. package/dist/lib/use-morph.d.ts +13 -7
  346. package/dist/lib/use-morph.js +4 -3
  347. package/dist/lib/use-touch-primary.js +1 -1
  348. package/dist/lib/utils.js +1 -1
  349. package/dist/lib/weight-label.d.ts +26 -0
  350. package/dist/lib/weight-label.js +7 -0
  351. package/dist/preset.d.ts +4 -8
  352. package/dist/preset.js +8 -8
  353. package/dist/primitives/code/index.js +8 -8
  354. package/dist/primitives/craft/index.d.ts +1 -1
  355. package/dist/primitives/craft/index.js +13 -12
  356. package/dist/primitives/fluid-hover/index.d.ts +13 -14
  357. package/dist/primitives/fluid-hover/index.js +13 -10
  358. package/dist/primitives/morph/index.d.ts +1 -1
  359. package/dist/primitives/morph/index.js +20 -16
  360. package/dist/primitives/motion/index.d.ts +2 -0
  361. package/dist/primitives/motion/index.js +14 -11
  362. package/dist/primitives/scroll-area/index.d.ts +5 -4
  363. package/dist/primitives/scroll-area/index.js +5 -5
  364. package/dist/primitives/separator/index.d.ts +12 -11
  365. package/dist/primitives/separator/index.js +2 -2
  366. package/dist/primitives/sizes/index.d.ts +17 -4
  367. package/dist/primitives/sizes/index.js +7 -4
  368. package/dist/primitives/skeleton/index.d.ts +8 -8
  369. package/dist/primitives/skeleton/index.js +7 -6
  370. package/dist/primitives/surface/index.d.ts +12 -25
  371. package/dist/primitives/surface/index.js +8 -6
  372. package/dist/shared/{components-yxmxn2jp.js → components-07g2gbjy.js} +30 -75
  373. package/dist/shared/components-099sdasz.js +552 -0
  374. package/dist/shared/{components-bsqynhaj.js → components-0h3f5jae.js} +49 -51
  375. package/dist/shared/{components-wbbckbw8.js → components-0mrhj88d.js} +13 -12
  376. package/dist/shared/{components-0h78g3b5.js → components-0p2na0cp.js} +19 -47
  377. package/dist/shared/components-1a7cr7vh.js +40 -0
  378. package/dist/shared/components-1axxc3tk.js +334 -0
  379. package/dist/shared/components-1hc3xv0y.js +381 -0
  380. package/dist/shared/{components-gyt7my41.js → components-1jxw899c.js} +94 -84
  381. package/dist/shared/{components-jqpefjsn.js → components-1nv9q3s8.js} +24 -44
  382. package/dist/shared/components-1p3k62x2.js +137 -0
  383. package/dist/shared/{components-kz5q11pp.js → components-2xmke84n.js} +12 -4
  384. package/dist/shared/{components-c7rwx0ap.js → components-346ged8v.js} +24 -3
  385. package/dist/shared/{components-4j3t39dd.js → components-34brwmgp.js} +12 -11
  386. package/dist/shared/components-38wa9nx5.js +19 -0
  387. package/dist/shared/components-3hgk57s0.js +27 -0
  388. package/dist/shared/{components-px2zm7dc.js → components-3js2vgds.js} +13 -6
  389. package/dist/shared/{components-ctqmge8t.js → components-3m4rqrqm.js} +10 -3
  390. package/dist/shared/{components-3ey0hzpb.js → components-45r18egt.js} +11 -1
  391. package/dist/shared/components-50rh4ggz.js +54 -0
  392. package/dist/shared/components-5atrr490.js +99 -0
  393. package/dist/shared/components-5f3tq4qb.js +70 -0
  394. package/dist/shared/{components-dc5q749x.js → components-5vyaexsj.js} +16 -17
  395. package/dist/shared/{components-pwayrkw9.js → components-5ynncdpn.js} +5 -4
  396. package/dist/shared/{components-1e64t8aj.js → components-62mg6pab.js} +232 -93
  397. package/dist/shared/{components-drxrtnp2.js → components-6f5pyzb2.js} +8 -0
  398. package/dist/shared/{components-868v7scv.js → components-6xfhc5qm.js} +104 -169
  399. package/dist/shared/{components-yhgq0qxx.js → components-7c4a0egq.js} +20 -12
  400. package/dist/shared/components-7fqnqbh0.js +79 -0
  401. package/dist/shared/components-7fsy0jxg.js +443 -0
  402. package/dist/shared/{components-p0fm0bab.js → components-7t3pz7v7.js} +496 -526
  403. package/dist/shared/components-85epgxwf.js +620 -0
  404. package/dist/shared/{components-wknae3m4.js → components-86vvx0c8.js} +75 -121
  405. package/dist/shared/{components-wgtjt2af.js → components-88ktjdg0.js} +30 -27
  406. package/dist/shared/{components-ft3zdc79.js → components-88r046aa.js} +6 -6
  407. package/dist/shared/{components-xd3emmy4.js → components-8hfrd2fk.js} +1462 -1464
  408. package/dist/shared/components-8sazy704.js +146 -0
  409. package/dist/shared/{components-rrbpmfx4.js → components-8wp8d8q1.js} +8 -0
  410. package/dist/shared/{components-rtadhd9j.js → components-9ybenn5v.js} +16 -16
  411. package/dist/shared/components-amsc86fb.js +293 -0
  412. package/dist/shared/{components-9as3rf68.js → components-az04rmng.js} +12 -6
  413. package/dist/shared/components-bdkm2jzy.js +34 -0
  414. package/dist/shared/{components-xjkdvnbg.js → components-be3wggg1.js} +54 -48
  415. package/dist/shared/components-bkwjvvkh.js +18 -0
  416. package/dist/shared/{components-vf45j12c.js → components-ceyn28cf.js} +7 -0
  417. package/dist/shared/{components-3h92d94m.js → components-cy5z8zxy.js} +1 -2
  418. package/dist/shared/components-dm86y7b3.js +105 -0
  419. package/dist/shared/{components-c9yr4ed1.js → components-ejn6tvbw.js} +8 -6
  420. package/dist/shared/{components-34txk9rj.js → components-ew4wq7mj.js} +7 -0
  421. package/dist/shared/{components-svkt577j.js → components-f75y4gn8.js} +53 -70
  422. package/dist/shared/components-f9adtfq8.js +34 -0
  423. package/dist/shared/{components-2a7hcand.js → components-gbsdhmrv.js} +48 -83
  424. package/dist/shared/{components-9sttq78t.js → components-gc5zky2w.js} +54 -59
  425. package/dist/shared/{components-bae8sbjx.js → components-gkdx1787.js} +12 -6
  426. package/dist/shared/{components-124epb7f.js → components-grxgqa75.js} +3 -7
  427. package/dist/shared/components-gw0wd7gd.js +986 -0
  428. package/dist/shared/components-j4z3rtw2.js +179 -0
  429. package/dist/shared/{components-t5pk5nmc.js → components-j8tcbm8y.js} +927 -953
  430. package/dist/shared/components-jm91mjm1.js +297 -0
  431. package/dist/shared/{components-b94t6qtj.js → components-jtfptckj.js} +44 -39
  432. package/dist/shared/components-jx9qb4z8.js +63 -0
  433. package/dist/shared/components-k785rge6.js +336 -0
  434. package/dist/shared/{components-r8eqs7gz.js → components-k81x1aea.js} +10 -6
  435. package/dist/shared/{components-qx27excf.js → components-kn5c7652.js} +11 -13
  436. package/dist/shared/components-mse06t0x.js +31 -0
  437. package/dist/shared/{components-cet3jpa0.js → components-n7e31ct4.js} +71 -49
  438. package/dist/shared/components-nskr4hwg.js +1008 -0
  439. package/dist/shared/components-nv5m3gcv.js +37 -0
  440. package/dist/shared/components-nwa2a9tq.js +27 -0
  441. package/dist/shared/{components-f7h57m6t.js → components-p0x8ren6.js} +3 -1
  442. package/dist/shared/{components-2krsc300.js → components-p0z99d5b.js} +67 -92
  443. package/dist/shared/{components-b1e239g3.js → components-pa43g2r2.js} +15 -4
  444. package/dist/shared/{components-m06yq8wk.js → components-pedbt2dc.js} +35 -49
  445. package/dist/shared/components-pva1wj1r.js +27 -0
  446. package/dist/shared/components-q4wyd06h.js +382 -0
  447. package/dist/shared/{components-71nbt03m.js → components-qrpdtvxa.js} +12 -45
  448. package/dist/shared/components-r33dxr5j.js +91 -0
  449. package/dist/shared/{components-005jt2nz.js → components-re8p99fj.js} +53 -179
  450. package/dist/shared/components-s217vq1n.js +35 -0
  451. package/dist/shared/{components-vc864c51.js → components-sesrjvcc.js} +7 -6
  452. package/dist/shared/{components-qh1cvj6p.js → components-skn189mp.js} +29 -36
  453. package/dist/shared/{components-tz4gaf1v.js → components-tcyz2tdn.js} +9 -1
  454. package/dist/shared/components-tjxy84s9.js +53 -0
  455. package/dist/shared/components-tnj6mkhg.js +89 -0
  456. package/dist/shared/{components-de99ykt7.js → components-tz0axc0f.js} +1 -0
  457. package/dist/shared/components-v2j3jx89.js +7 -0
  458. package/dist/shared/components-vcte8p75.js +71 -0
  459. package/dist/shared/{components-c74gf16d.js → components-vgzerqt0.js} +34 -47
  460. package/dist/shared/components-vp6vzsee.js +30 -0
  461. package/dist/shared/components-vpkh6j83.js +42 -0
  462. package/dist/shared/{components-4nck8acq.js → components-wgd1nebp.js} +21 -14
  463. package/dist/shared/{components-pt5ftm4p.js → components-wrbw67f6.js} +10 -3
  464. package/dist/shared/{components-tz1fv35x.js → components-wwd093xg.js} +1 -0
  465. package/dist/shared/components-wyfmhtw9.js +61 -0
  466. package/dist/shared/{components-d3shbwqq.js → components-xpw8dzb0.js} +16 -23
  467. package/dist/shared/{components-mattt5jp.js → components-xzcgr3gy.js} +62 -60
  468. package/dist/shared/{components-jcnjay5g.js → components-ycx2kxeq.js} +9 -1
  469. package/dist/shared/components-zbzx62pg.js +1771 -0
  470. package/dist/shared/{components-dtca4s6b.js → components-zf0nnvvg.js} +67 -147
  471. package/dist/shared/{components-h83az0bz.js → components-znspksk0.js} +9 -1
  472. package/dist/shared/components-zpatc9x3.js +78 -0
  473. package/dist/styles.css +218 -235
  474. package/dist/tailwind.css +20 -8
  475. package/dist/tokens.css +53 -68
  476. package/index.ts +16 -2
  477. package/lib/date-locale.ts +12 -149
  478. package/lib/date-mask.ts +146 -0
  479. package/lib/field-box.ts +117 -0
  480. package/lib/field-classes.ts +85 -100
  481. package/lib/fluid-hover-highlight.tsx +12 -57
  482. package/lib/focus-ring.tsx +25 -22
  483. package/lib/goo-indicator.tsx +2 -0
  484. package/lib/icon-context.tsx +23 -75
  485. package/lib/merge-refs.ts +29 -0
  486. package/lib/morph-layers.tsx +3 -1
  487. package/lib/morph-part.tsx +5 -3
  488. package/lib/overlay.tsx +118 -0
  489. package/lib/popup-rows.tsx +149 -0
  490. package/lib/popup-surface.tsx +52 -0
  491. package/lib/popup.ts +10 -9
  492. package/lib/rect.ts +48 -0
  493. package/lib/reduced-motion.ts +2 -0
  494. package/lib/row-group.tsx +113 -0
  495. package/lib/row-index.tsx +27 -10
  496. package/lib/scroll-column.tsx +26 -53
  497. package/lib/shape-classes.ts +56 -0
  498. package/lib/shape-context.tsx +10 -79
  499. package/lib/size-context.tsx +8 -21
  500. package/lib/size-scale.ts +3 -9
  501. package/lib/slot.tsx +124 -0
  502. package/lib/spinner-glyph.tsx +27 -0
  503. package/lib/springs.ts +8 -9
  504. package/lib/surface-classes.ts +3 -8
  505. package/lib/surface-context.tsx +10 -5
  506. package/lib/use-autosize-textarea.ts +64 -0
  507. package/lib/use-controllable-state.ts +30 -15
  508. package/lib/use-fluid-hover.ts +9 -11
  509. package/lib/use-is-mobile.ts +5 -5
  510. package/lib/use-iso-layout-effect.ts +14 -0
  511. package/lib/use-keyboard-nav-gate.ts +5 -6
  512. package/lib/use-merge-split.tsx +5 -15
  513. package/lib/use-morph.ts +34 -76
  514. package/lib/use-touch-primary.tsx +5 -5
  515. package/lib/utils.ts +4 -11
  516. package/lib/weight-label.tsx +69 -0
  517. package/package.json +57 -194
  518. package/primitives/code/index.tsx +4 -2
  519. package/primitives/craft/demos.tsx +4 -2
  520. package/primitives/craft/examples.mdx +32 -34
  521. package/primitives/craft/index.tsx +3 -0
  522. package/primitives/fluid-hover/examples.mdx +1 -1
  523. package/primitives/fluid-hover/index.tsx +33 -68
  524. package/primitives/morph/examples.mdx +16 -19
  525. package/primitives/morph/index.tsx +5 -3
  526. package/primitives/motion/examples.mdx +3 -3
  527. package/primitives/motion/index.tsx +6 -22
  528. package/primitives/scroll-area/examples.mdx +4 -4
  529. package/primitives/scroll-area/index.tsx +16 -41
  530. package/primitives/separator/examples.mdx +2 -2
  531. package/primitives/separator/index.tsx +15 -14
  532. package/primitives/sizes/examples.mdx +1 -1
  533. package/primitives/sizes/index.tsx +28 -42
  534. package/primitives/skeleton/examples.mdx +6 -6
  535. package/primitives/skeleton/index.tsx +24 -10
  536. package/primitives/skeleton/skeleton.css +8 -3
  537. package/primitives/surface/examples.mdx +11 -11
  538. package/primitives/surface/index.tsx +15 -40
  539. package/primitives/surface/surface.css +1 -1
  540. package/DESIGN.md +0 -623
  541. package/components/inputs/select/variants.ts +0 -32
  542. package/components/navigation/sidebar/sidebar-core.tsx +0 -1408
  543. package/components/navigation/sidebar/sidebar-menu.tsx +0 -1495
  544. package/components/navigation/sidebar/variants.ts +0 -55
  545. package/components/navigation/tabs-subtle/examples.mdx +0 -49
  546. package/components/navigation/tabs-subtle/index.tsx +0 -512
  547. package/components/overlays/dropdown/menu-parts.tsx +0 -725
  548. package/components/overlays/toast/global-demo.tsx +0 -72
  549. package/dist/components/inputs/color-picker/variants.d.ts +0 -61
  550. package/dist/components/inputs/color-picker/variants.js +0 -28
  551. package/dist/components/inputs/select/variants.d.ts +0 -5
  552. package/dist/components/inputs/select/variants.js +0 -6
  553. package/dist/components/navigation/sidebar/variants.d.ts +0 -25
  554. package/dist/components/navigation/sidebar/variants.js +0 -28
  555. package/dist/components/navigation/tabs-subtle/index.d.ts +0 -73
  556. package/dist/components/navigation/tabs-subtle/index.js +0 -24
  557. package/dist/docs/index.d.ts +0 -83
  558. package/dist/docs/index.js +0 -288
  559. package/dist/docs/vite.d.ts +0 -31
  560. package/dist/docs/vite.js +0 -45
  561. package/dist/lib/field-variants.d.ts +0 -47
  562. package/dist/lib/field-variants.js +0 -26
  563. package/dist/lib/inert.d.ts +0 -9
  564. package/dist/lib/inert.js +0 -8
  565. package/dist/lib/row-order.d.ts +0 -28
  566. package/dist/lib/row-order.js +0 -10
  567. package/dist/lib/shape-radius.d.ts +0 -19
  568. package/dist/lib/shape-radius.js +0 -6
  569. package/dist/shared/components-01w9qcfa.js +0 -277
  570. package/dist/shared/components-26snnbs9.js +0 -322
  571. package/dist/shared/components-2qbqqpgq.js +0 -1545
  572. package/dist/shared/components-303jf96s.js +0 -1478
  573. package/dist/shared/components-4vfm04wq.js +0 -82
  574. package/dist/shared/components-54nq988h.js +0 -123
  575. package/dist/shared/components-7qx17na9.js +0 -300
  576. package/dist/shared/components-7s7pykk5.js +0 -281
  577. package/dist/shared/components-8jrk5eye.js +0 -448
  578. package/dist/shared/components-91zw3d9f.js +0 -136
  579. package/dist/shared/components-9jmjnkqd.js +0 -503
  580. package/dist/shared/components-adkarj8n.js +0 -35
  581. package/dist/shared/components-c5w5zk0s.js +0 -218
  582. package/dist/shared/components-cnead5qm.js +0 -185
  583. package/dist/shared/components-czdvj1a8.js +0 -266
  584. package/dist/shared/components-dcc02hs2.js +0 -31
  585. package/dist/shared/components-dhgk6mbt.js +0 -16
  586. package/dist/shared/components-g3eafs70.js +0 -337
  587. package/dist/shared/components-gx4h5rbb.js +0 -40
  588. package/dist/shared/components-h6p86be3.js +0 -19
  589. package/dist/shared/components-hdzrqqpx.js +0 -55
  590. package/dist/shared/components-hgv6tygd.js +0 -986
  591. package/dist/shared/components-krtx3m5b.js +0 -84
  592. package/dist/shared/components-kswxnm3h.js +0 -24
  593. package/dist/shared/components-mhza2wdn.js +0 -482
  594. package/dist/shared/components-mrbaxt8q.js +0 -62
  595. package/dist/shared/components-pv1dyrtn.js +0 -678
  596. package/dist/shared/components-s8yqk2dc.js +0 -124
  597. package/dist/shared/components-syynwm1r.js +0 -114
  598. package/dist/shared/components-tv7b8tet.js +0 -271
  599. package/dist/shared/components-w2jqa6hx.js +0 -404
  600. package/dist/shared/components-xdqmt6ed.js +0 -20
  601. package/dist/shared/components-y0kfy2g4.js +0 -578
  602. package/dist/shared/components-z3v0n0de.js +0 -11
  603. package/dist/shared/components-z8fedth5.js +0 -305
  604. package/dist/shared/components-zkk3fmw8.js +0 -150
  605. package/dist/tokens/colors.css +0 -230
  606. package/dist/tokens/motion.css +0 -40
  607. package/dist/tokens/radius.css +0 -10
  608. package/dist/tokens/spacing.css +0 -9
  609. package/dist/tokens/typography.css +0 -119
  610. package/docs/chrome.css +0 -120
  611. package/docs/chrome.tsx +0 -283
  612. package/docs/index.ts +0 -9
  613. package/docs/vite.ts +0 -85
  614. package/lib/field-variants.ts +0 -117
  615. package/lib/inert.ts +0 -22
  616. package/lib/row-order.tsx +0 -126
  617. package/lib/shape-radius.ts +0 -67
  618. package/lib/slot.ts +0 -115
  619. package/preset.ts +0 -199
package/README.md CHANGED
@@ -1,24 +1,13 @@
1
- # UI — Fluid Functionalism for modo
1
+ # @justanarthur/modo-ui
2
2
 
3
- The UI design system is a port of [Fluid Functionalism](https://www.fluidfunctionalism.com)
4
- (FF) into modo's structure. FF is a shadcn-style component registry by Micka
5
- Touillaud / mickadesign ([repo](https://github.com/mickadesign/fluid-functionalism),
6
- MIT). It layers motion springs, a fluid hover highlight, a two-step size ladder,
7
- an eight-level elevated surface system and Inter weight animation on top of
8
- Radix or Base UI primitives.
3
+ A React design system: [Fluid Functionalism](https://www.fluidfunctionalism.com)
4
+ (Base UI flavor) on UnoCSS, with a liquid morph layer on top. Motion springs, a
5
+ fluid hover highlight, a two-step size ladder and an eight-level elevated
6
+ surface system come from Fluid Functionalism; overlays that grow out of
7
+ whatever opened them, and indicators that melt between items, are local.
9
8
 
10
- This port differs from the upstream registry in three ways:
11
- - It uses the **Base UI** flavor.
12
- - **UnoCSS** (`presetWind4`) replaces Tailwind CSS v4.
13
- - **[`cn`](https://github.com/shadcn-ui/cn)** replaces clsx + tailwind-merge.
14
-
15
- The sibling `../fluid-functionalism` package is a different project: a Radix
16
- flavor pulled with the shadcn CLI, still on Tailwind.
17
-
18
- On top of FF, the overlays morph: they grow out of whatever opened them, with
19
- a liquid "goo" neck by default. That layer is local code (`lib/use-morph.ts`,
20
- `lib/morph-layers.tsx`, documented by `primitives/morph`), with techniques
21
- taken from three more MIT projects (see [Morph sources](#morph-sources)).
9
+ **Live docs:** https://justanarthur.github.io/modo/ui/ — every component with
10
+ its props and live examples, built with [modo](https://github.com/justAnArthur/modo).
22
11
 
23
12
  ## Install
24
13
 
@@ -26,38 +15,55 @@ taken from three more MIT projects (see [Morph sources](#morph-sources)).
26
15
  npm install @justanarthur/modo-ui
27
16
  ```
28
17
 
29
- React 18 or later is a peer dependency. Import components from the package
30
- root, or one item per subpath (`@justanarthur/modo-ui/components/button`,
31
- `@justanarthur/modo-ui/components/overlays/dialog`, …):
18
+ React 18 or later is a peer dependency. Import from the package root, or one
19
+ item per subpath:
32
20
 
33
21
  ```tsx
34
22
  import { Button, Switch } from '@justanarthur/modo-ui'
23
+ import Dialog from '@justanarthur/modo-ui/components/overlays/dialog'
35
24
  ```
36
25
 
37
- ### Styles
26
+ Subpaths follow the docs' tiers and groups: `primitives/*`, `components/*`
27
+ (`components/button`, `components/inputs/select`, …) and `blocks/*`
28
+ (`blocks/sidebar-app`). The shared systems are subpaths too, for components of
29
+ your own: `lib/utils`, `lib/springs`, `lib/size-scale`, `lib/shape-classes`,
30
+ `lib/field-classes`, `lib/field-box`, `lib/size-context`, `lib/shape-context`,
31
+ `lib/icon-context`, `lib/use-controllable-state`, `lib/use-morph` and
32
+ `lib/goo-indicator`; Button's, Badge's and FileDropzone's pure tables are
33
+ `components/button/variants`, `components/badge/variants` and
34
+ `components/inputs/file-dropzone/variants`.
35
+
36
+ ## Styles
38
37
 
39
- Pick one of three ways in. The components are styled with utility classes,
40
- so either take them prebuilt or let your own Tailwind or UnoCSS generate them
41
- by scanning the package's `dist/`. Scanning emits each class once, beside your
42
- own.
38
+ The components are styled with utility classes. Take them prebuilt, or let
39
+ your own Tailwind or UnoCSS generate them from the package's `dist/`, so each
40
+ class is emitted once, beside your own. Pick one path.
43
41
 
44
- **Prebuilt**: no CSS tooling needed. It includes the reset, the tokens, the
45
- base styles and every utility the components use:
42
+ ### Prebuilt CSS
43
+
44
+ No CSS tooling needed. `styles.css` holds the reset, the tokens, the base
45
+ styles, the Inter variable font and every utility the components use:
46
46
 
47
47
  ```ts
48
48
  import '@justanarthur/modo-ui/styles.css'
49
49
  ```
50
50
 
51
- **Tailwind CSS v4**: the theme, the token utilities, the `dark:` variant and
52
- `@source` for the components ship in one file:
51
+ ### Tailwind CSS v4
52
+
53
+ `tailwind.css` imports the tokens and base styles, adds `@source` for the
54
+ components, the `dark:` variant, the theme (`@theme inline`) and the token
55
+ utilities (`text-body`, `weight-medium`, `duration-fast`, …):
53
56
 
54
57
  ```css
55
58
  @import "tailwindcss";
56
59
  @import "@justanarthur/modo-ui/tailwind.css";
57
60
  ```
58
61
 
59
- **UnoCSS** (`presetWind4`): add the preset and the components' content, then
60
- import the tokens and base styles:
62
+ ### UnoCSS
63
+
64
+ Add the preset next to `presetWind4`, and the components' classes through
65
+ `modoUiContent` (UnoCSS reads `content` from your config only, never from a
66
+ preset, so this part can't ship inside it):
61
67
 
62
68
  ```ts
63
69
  // uno.config.ts
@@ -70,642 +76,190 @@ export default defineConfig({
70
76
  })
71
77
  ```
72
78
 
79
+ Then import the generated CSS and the tokens with the base styles:
80
+
73
81
  ```ts
74
82
  import 'virtual:uno.css'
75
83
  import '@justanarthur/modo-ui/base.css'
76
84
  ```
77
85
 
78
- `tokens.css` holds the CSS variables alone. Each token file also ships on its
79
- own, unchanged, as `@justanarthur/modo-ui/tokens/<group>.css` (`colors`, `motion`,
80
- `radius`, `spacing`, `typography`), for a host whose modo viewer reads `tokens/*.css`.
86
+ `@justanarthur/modo-ui/tokens.css` holds the CSS variables alone, for a host
87
+ that brings its own base styles.
81
88
 
82
- ### Theme
89
+ ## Theming and dark mode
83
90
 
84
- Every color is a `light-dark()` token, so `color-scheme` picks the side: it
85
- follows the OS until `<html>` (or any subtree) carries `light` or `dark`.
86
- `dark:` utilities match inside a `.dark` ancestor, so set the class whenever
87
- you pin dark mode:
91
+ Every color is a `light-dark()` token, so `color-scheme` picks the side. It
92
+ follows the OS until `<html>` (or any subtree) carries the `light` or `dark`
93
+ class. The `dark:` utilities match inside a `.dark` ancestor, so set the class
94
+ whenever you pin a scheme:
88
95
 
89
96
  ```ts
90
97
  document.documentElement.classList.toggle('dark', dark)
91
98
  document.documentElement.classList.toggle('light', !dark)
92
99
  ```
93
100
 
94
- ## Source
95
-
96
- - Repository: `github.com/mickadesign/fluid-functionalism`
97
- - Commit: `b3587bdbd83fc66c2a6aae3817ffb856cb09260b`
98
- - License: MIT © 2026 Micka Touillaud. The full text is in
99
- [`LICENSE.fluid-functionalism`](./LICENSE.fluid-functionalism), copied
100
- verbatim.
101
- - Flavor: `registry/base/*` wherever upstream ships a flavored file, and
102
- `registry/default/*` otherwise. The Base UI flavor is pinned to
103
- `@base-ui/react@1.4.1`, the version upstream was tested with.
104
-
105
- Every vendored file opens with a plain `/* */` header. The header names the
106
- upstream path and commit, carries the MIT notice, and lists every local
107
- modification. The vendored code below the header keeps upstream's formatting.
108
- Files written for this port (`preset.ts`, `uno.config.ts`, `vite.ts`, `index.ts`,
109
- `scripts/build-css.ts`, `docs/*`,
110
- `lib/use-controllable-state.ts`, `primitives/code/index.tsx`, `primitives/craft/*`, the morph files
111
- in `lib/` (`use-morph.ts`, `reduced-motion.ts`, `morph-layers.tsx`, `morph-part.tsx`, `goo-indicator.tsx`,
112
- `slot.ts`) and `primitives/morph/index.tsx`, `blocks/sidebar-app/index.tsx`,
113
- and the local components marked "— (local)" below) use this repo's style: single quotes and no semicolons.
114
-
115
- ### Morph sources
116
-
117
- | Project | Repository @ commit | License | What it contributes |
118
- |---|---|---|---|
119
- | beUI | `github.com/starc007/ui-components` @ `de52f337e520e7ee37749b36eb1c32df86137bcb` | MIT © 2026 Saurabh Chauhan, [`LICENSE.beui`](./LICENSE.beui) | the gooey popover's rect interpolation, rounded-rect path, source cutout and goo filter; the morph select; the morphing search (idea only) |
120
- | motion-primitives | `github.com/ibelick/motion-primitives` @ `120f64f6ca60348e251f929e9c81f11ccbe45eda` | MIT © 2024 ibelick, [`LICENSE.motion-primitives`](./LICENSE.motion-primitives) | the morphing popover and morphing dialog (trigger growing into the panel, shared parts) |
121
- | Sileo | `github.com/hiaaryan/sileo` @ `9793f844349983e140cf33cebbb8f51626d41407` | MIT, [`LICENSE.sileo`](./LICENSE.sileo) | the goo blur as a share of the surface radius; the gooey toast |
122
-
123
- Sileo declares MIT in its `package.json` but ships no LICENSE file, so
124
- `LICENSE.sileo` is the standard MIT text naming the repository's owner.
125
- beUI's and motion-primitives' are copied verbatim.
126
-
127
- Only visuals come from these projects. Base UI keeps all behavior
128
- (positioning, focus, dismissal, hover and tap, scroll lock), so none of
129
- their own hooks for it (click-outside, focus traps, dismissal, gestures,
130
- positioning) are ported.
131
-
132
- ## Layout
133
-
134
- | Path | What it holds |
135
- |---|---|
136
- | `AGENTS.md` | The ui-specific guide for coding agents (where things live, the rules that matter most, the checks); `CLAUDE.md` imports it. |
137
- | `DESIGN.md` | The design language in Google's [DESIGN.md](https://github.com/google-labs-code/design.md) format: the tokens as front matter, the rules as prose. Agents building here follow the `modo-ui` skill (`.claude/skills/modo-ui` at the repo root). |
138
- | `tokens/*.css` | Colors, typography (`--font-sans`, `--text-*`), motion (`--duration-*`), radius and spacing. Shipped per group as `dist/tokens/*.css` (`./tokens/*`). |
139
- | `base.css` | Theme switching, base styles, focus fallback, scrollbars, shimmer/spinner keyframes and `.scroll-fade`. Shipped in the package. The inline `code` chip applies only inside the docs shell, `data-modo="prose"` and `.modo-prose`. |
140
- | `global.css` | The docs site's stylesheet (`modo.config.ts` `css`): imports `base.css`, then `docs/chrome.css`. |
141
- | `preset.ts` | The UnoCSS preset (theme and token utilities), shipped as `@justanarthur/modo-ui/unocss`. |
142
- | `uno.config.ts`, `vite.ts` | The UnoCSS setup of the docs site and the prebuilt CSS (see below); `vite.ts` also applies the docs chrome's `docsTheme` plugin. |
143
- | `index.ts`, `bunup.config.ts`, `scripts/build-css.ts` | The package build: `bun run build` writes the components, their types and the stylesheets to `dist/`. The docs site builds with `bun run build:docs` into `docs-dist/`. |
144
- | `scripts/exports.ts`, `scripts/use-client.ts`, `scripts/check-singletons.ts` | Packaging around that build. `exports.ts` (first step of `bun run build`) writes one `./lib/<name>` export per `lib/` module into `package.json`, plus `./components/*/variants` and `./blocks/*/variants` for the items' server-callable `variants.ts` entries; commit the `package.json` it leaves. `use-client.ts` (after bunup) puts `"use client"` on the emitted modules that render, call a hook or create a context, or use a binding from one; pure helpers (`cn`, class tables, springs, `variants.ts`) and re-export entries stay directive-free so a React Server Component can call them (`--list` prints the split). `check-singletons.ts` (`bun run check:dist`) checks that every React context and the `toast()` manager exist once in `dist/`, and that every entry has its `.d.ts`. `typesVersions` in `package.json` maps every public subpath to `dist/**/*.d.ts`, so `moduleResolution: node` consumers do not type-check the shipped source. |
145
- | `lib/` | FF's shared system files (upstream `lib/`, `hooks/` and the fluid-hover highlight, flat, upstream names), imported relatively by items. modo only scans the tier folders, so it never mistakes them for items. |
146
- | `docs/` | The docs chrome, shipped: `chrome.tsx` (the `Button`, `Link`, `Icon`, `Select` and `DocsNav` shell-slot adapters and the `ThemeSwitcher` panel item, re-exported by `index.ts` as `@justanarthur/modo-ui/docs`), `chrome.css` (the inset layout and the look of the chrome, `@justanarthur/modo-ui/docs/chrome.css`) and `vite.ts` (`docsTheme`, the pre-paint theme controller, `@justanarthur/modo-ui/docs/vite`). `modo.config.ts` picks the slots by export name (`./docs#DocsNav`); another design system documented with modo points at the same module by package specifier (see **The docs chrome, for another design system**). The barrel (`index.ts`) never imports it, `bun run check:dist` fails if it does. |
147
- | `primitives/<id>/` | FF's "System" pages: `index.tsx` (component + TSDoc prose) and `examples.mdx`, pulled in by `@example {@include ./examples.mdx}`. |
148
- | `components/[<group>/]<id>/` | FF's "Components" pages, same shape. The `AI/`, `inputs/` (with `inputs/date-time/`), `navigation/` and `overlays/` group folders become sidebar sub-groups and overview sections; the core display items stay ungrouped. |
149
- | `blocks/<id>/` | Compositions of several items, same shape: `sidebar-app`, FF's sidebar preset `sa1FQfCxH6` as an app shell, with the header and footer blocks it is built from beside it. |
150
-
151
- ## Upstream → local file map
152
-
153
- ### Shared system (`lib/`)
154
-
155
- | Upstream (`registry/default/…`) | Local | Modifications |
156
- |---|---|---|
157
- | `lib/utils.ts` | `lib/utils.ts` | `extendTailwindMerge` → `createCn` from `cn/config`, with the same font-size group extension; the local token utilities join their groups too (compact and `micro` type roles as font-size, `weight-*`, the `duration-*` / `delay-*` motion tiers, `rounded-box\|glyph`) |
158
- | `lib/springs.ts` | `lib/springs.ts` | `goo` tier added (the morph engine's goo: 250ms to land, bounce 0.15, a 200ms spring back); `exitFallbackMs` also reads a spring exit's `visualDuration` |
159
- | `lib/font-weight.ts` | — | not ported: its `fontWeights` became the `--weight-*` tokens in `tokens/typography.css` (the `weight-*` utilities) |
160
- | `lib/popup.ts` | `lib/popup.ts` | `popupMotionClass` dropped (unused since the popups morph) |
161
- | `lib/shape-context.tsx` | `lib/shape-context.tsx` | `"use client"` dropped; `--shape-input-radius` is published through `claimShapeRadius` and given back on unmount |
162
- | — (new) | `lib/shape-radius.ts` | Local addition: the stack of `ShapeProvider` claims on `--shape-input-radius` (`<html>`), so an unmounting provider restores the one below it or the page's own value; plain data, tested without a DOM |
163
- | `lib/size-context.tsx` | `lib/size-context.tsx` | `"use client"` dropped; `SizeProvider` moved to `primitives/sizes` (the documented item), with `SizeContext` exported for it; `sizeMap`, `typeScale` and their types moved to `size-scale.ts` and re-exported |
164
- | `lib/size-context.tsx` (`sizeMap`, `typeScale`) | `lib/size-scale.ts` | The ladder's plain data, split out so server code can read it (no JSX, hooks or contexts); `sizeMap` text classes → `text-body` / `text-body-compact` |
165
- | `lib/icon-context.tsx` | `lib/icon-context.tsx` | `"use client"` dropped; `size`/`strokeWidth` widened to `number \| string` for lucide v1 + React 18 types |
166
- | `lib/surface-context.tsx` | `lib/surface-context.tsx` | `"use client"` dropped |
167
- | `lib/surface-classes.ts` | `lib/surface-classes.ts` | `SURFACE_HOVER_*` and `surfaceHoverClasses` dropped (only Sidebar used them) |
168
- | `hooks/use-fluid-hover.ts` | `lib/use-fluid-hover.ts` | `"use client"` dropped; `sessionRef` typed `MutableRefObject<number>` (React 18) |
169
- | `hooks/use-merge-split.tsx` | `lib/use-merge-split.tsx` | `"use client"` dropped; `framer-motion` → `motion/react`; relative imports; the merge/split choreography replaced by per-row blocks melted through `GooLayer`; exports and `SelBlock`'s `key`/rect/`radii`/`instant` kept |
170
- | `hooks/use-keyboard-nav-gate.ts` | `lib/use-keyboard-nav-gate.ts` | `"use client"` dropped; relative imports |
171
- | `hooks/use-touch-primary.tsx` | `lib/use-touch-primary.tsx` | `"use client"` dropped |
172
- | `sidebar-core.tsx` (`useIsMobile`) | `lib/use-is-mobile.ts` | Moved out of the sidebar, unchanged, so the date and time pickers share it |
173
- | `fluid-hover-highlight.tsx` | `lib/fluid-hover-highlight.tsx` | `"use client"` dropped; `framer-motion` → `motion/react`; relative imports; the fill is a `GooIndicator` (melts from row to row), props unchanged |
174
- | — (new) | `lib/use-controllable-state.ts` | Local addition: controlled + uncontrolled state, Base UI style |
175
- | — (new) | `lib/use-morph.ts` | Local addition: the morph engine (source rect → popup box on a spring tier, exit hold for Base UI's unmount), geometry after beUI's popover; goo runs on its own `spring.goo` with a blur of at least 8px that eases to nothing as the surface lands, so the neck pinches off; a close-only `exit` override, an `instant` predicate that ends a run at once, press points from clicks, context menus and long presses (a droplet source for `from="pointer"`), cleanup when the popup unmounts mid-run; focus goes back to the trigger when a closed popup that held it is gone and Base UI skipped the return (the exit hold makes a menu read the pointer leaving the inert popup as a hover close) |
176
- | — (new) | `lib/reduced-motion.ts` | Local addition: `useReduceMotion`, the one reduced-motion read for the morph layer and the liquid indicators — the OS setting, or a `MotionConfig` asking for it (motion's `useReducedMotionConfig` alone ignores the OS without `<MotionConfig reducedMotion="user">`) |
177
- | — (new) | `lib/field-classes.ts` | Local addition: the field ladder FF repeats per text field (rest → muted fill on hover or a group's `data-active` → card fill on focus; `data-invalid` keeps a destructive ring), as `fieldVariants` + `fieldIconClasses`, shared by Input, Textarea, Combobox and Sidebar's input; `useFieldBox` (variant, state attributes incl. `readOnly` / `required`, radius, inset) + `focusControlOnPress`, the box Input, Textarea, NumberInput, Combobox's fields and the date/time pickers' field build on, so each takes `variant`; `FieldStateContext`, which hands a `Field`'s state to its control; the pure class tables live in `field-variants.ts` and are re-exported here |
178
- | — (new) | `lib/field-variants.ts` | Local addition: the field ladder's pure class tables (box, icon, adornment, action, label/description insets), split from `field-classes.ts` so a React Server Component can call them |
179
- | — (new) | `lib/date-locale.ts` | Local addition: what the date and time pickers read off a react-day-picker (date-fns) locale — the hour cycle (Intl), typed dates, times and months in the locale's formats (date-fns `parse` with `P`…`PPPP`), field names for column labels (`Intl.DisplayNames`); `resolveLocale` (a BCP 47 tag → an Intl-backed date-fns Locale, after utegsk/ui's `localeFromTag`), `formatTime` on an explicit hour cycle, `parseDateTimeText` / `parseMonthNameText` |
180
- | — (new) | `lib/row-order.tsx` | Local addition: document-order row numbering for menus and lists (`useRowOrder`, `useRowSlot`, `RowOrderContext`), so a row's `index` is optional; unlike `row-index.tsx` (direct children) it reaches rows anywhere below the panel; labels, separators and groups are numbered without a rect, so a selection run never melts across them. Lifted out of Dropdown; an explicit `index` on every row skips the DOM sort |
181
- | — (new) | `lib/inert.ts` | Local addition: `inert` that holds on React 18 and 19 (18 passes it through as an unknown attribute and needs `''`, 19 reads a boolean and drops `''`): `inertProps(on)` to spread, `markInert` as a ref for an element that is always inert; Sidebar's folded and collapsed parts, Tabs' ghost label |
182
- | — (new) | `lib/focus-ring.tsx` | Local addition: `FocusRing`, the one keyboard ring a list panel draws, 2px outside the focused row and springing between rows (a snap under reduced motion); radius from the surrounding shape, or pinned with `shape` (popups pin `rounded`); Dropdown and its submenus, NavigationMenu, Select |
183
- | — (new) | `lib/scroll-column.tsx` | Local addition: `ScrollColumn`, the scrolling option list beside a calendar (months, years, hours, minutes) or a strip above it: the pick gets a dot, a run of `inView` options one band, the followed option stays centred; fluid hover, listbox semantics, arrow keys; `dividedColumns` puts a hairline between neighbours; `layout="grid"` (`columns` 2–6, 2-D fluid hover, row-wise arrow keys) after utegsk/ui's 0.14 grid picker |
184
- | — (new) | `lib/slot.ts` | Local addition: Dialog's `render` / `asChild` slot shape (`SlotProps`, `slotRender`), shared by every overlay part that wraps a control; `children` fill a `render` element that has none of its own (Base UI semantics), and `nativeButton` reaches the Base UI triggers and closes (`false` for a `<div>` or link); `cloneSlot` / `mergeSlotProps` / `composeRefs` are Radix Slot's merge (child props win, `on*` handlers chain child-first, `className` joins, `style` merges, refs compose; React 18 `forwardRef` and React 19 `props.ref`); `slotId(el, id)` hands a slot element's own `id` to the Base UI part, so triggers and Field.Control register the id the DOM carries |
185
- | — (new) | `lib/morph-part.tsx` | Local addition: `MorphPart` (shared parts over a motion `layoutId`, after motion-primitives' morphing dialog) and the scope contexts overlays provide |
186
- | — (new) | `lib/goo-indicator.tsx` | Local addition: `GooIndicator` (melts between items, a lingering blob follows it) and `GooLayer` (goo over the shapes' coverage, filled with their own token, on only while moving), on the engine's `GOO_MATRIX` / `GOO_BLUR_RATIO` |
187
- | — (new) | `lib/morph-layers.tsx` | Local addition: `MorphSurface`, the renderer (shapes layer with beUI's goo filter plus a `--shadow-color` hairline around the melted shape, surface background and shadow, clipped content) |
188
-
189
- ### Styles
190
-
191
- | Upstream | Local |
192
- |---|---|
193
- | `app/globals.css` §1 tokens | `tokens/colors.css`, with HEX converted to oklch. The surface ladder and shadows live in `primitives/surface/surface.css`. Local addition: the `--status-*` roles (toast states), by reference to the badge palette, `--destructive` and `--brand`; and the primary-action hooks `--primary`, `--primary-hover`, `--primary-active`, `--primary-foreground`, `--shadow-button-primary` (defaults: the ink, its 90% / 80% mixes toward the background, the background, a no-op shadow), read by Button's `primary` variant and by `bg-primary` / `text-primary-foreground`. |
194
- | `app/globals.css` §2 theme switching | `base.css` (`color-scheme`, `--overlay`) and `surface.css` (`--shadow-N` per scheme) |
195
- | `app/globals.css` §3 `@theme inline` | `preset.ts` `theme` |
196
- | `app/globals.css` `--fs-*` + `@utility text-*` | `tokens/typography.css` `--text-*` and `preset.ts` `utilities` |
197
- | `app/globals.css` §4–6 | `base.css` |
198
- | `registry/default/lib/springs.ts` (as CSS) | `tokens/motion.css` (plus `--duration-goo` / `--duration-goo-exit`) |
199
-
200
- ### Items
201
-
202
- Every item goes through the same mechanical pass, so the tables below list
203
- only what is specific to it:
204
-
205
- - `"use client"` dropped (no RSC here).
206
- - Imports rewritten: `@/lib/*` → `../../lib/*`, `@/hooks/*` →
207
- `../../lib/*`, `SizeProvider` from `@/lib/size-context` →
208
- `../../primitives/sizes`, `@/lib/elevated` → `../../primitives/surface`,
209
- `@/components/ui/scroll-area` → `../../primitives/scroll-area`,
210
- `@/components/ui/fluid-hover-highlight` → `../../lib/fluid-hover-highlight`,
211
- `@/registry/radix/*` → the Base-flavor sibling, `framer-motion` →
212
- `motion/react`, `next/link` → a plain anchor.
213
- - A local `interface <Item>Props` whose members carry the FF docs API-table
214
- text, modo TSDoc written from the FF docs page, and `export default <Item>`.
215
- Upstream's named exports are kept. (Many members are re-declared in the
216
- interface body from when modo listed only those; it now reads props through
217
- the TypeScript compiler, inherited members included.)
218
-
219
- #### primitives
220
-
221
- | Item | Upstream | Local | Specific modifications |
222
- |---|---|---|---|
223
- | `Elevated` | `registry/default/lib/elevated.tsx` (+ `lib/surface-context.tsx`; docs "Surfaces") | `primitives/surface/index.tsx` | `.Provider` static (= `SurfaceProvider`); `useSurface` / `surfaceClasses` re-exported; `className`/`children` re-declared; `surface.css` co-located (modo injects it) |
224
- | `ScrollArea` | `registry/base/scroll-area.tsx` (docs "Scrollbars") | `primitives/scroll-area/index.tsx` | the root's forwardRef element type written out as `HTMLDivElement` (the parser needs a first type argument without `<`/`,`); `viewportClassName` documented; `.Bar` static (= `ScrollBar`) |
225
- | `SizeProvider` | `registry/default/lib/size-context.tsx` + `app/docs/sizes/page.tsx` | `primitives/sizes/index.tsx` | upstream's `SizeProvider`, moved here from the vendored context so modo documents it (sized components import it from here), with the hooks, maps and types re-exported; the live demos become static examples (Select/TabsSubtle/InputGroup/CheckboxGroup/Dropdown swapped for Button/Badge/Switch/Tabs, token-inspector overlay dropped); the token table and type scale are written out rather than rendered from `sizeMap` / `typeScale` |
226
- | `FluidHover` | `app/docs/fluid-hover/{page,demos}.tsx` over `registry/default/hooks/use-fluid-hover.ts` + `fluid-hover-highlight.tsx` | `primitives/fluid-hover/index.tsx` | new container (`FluidHover` + `FluidHover.Item`) around the hook/highlight pair so examples need no hooks; `items`, `renderItem`, `disabledIndices`, `columns`, `highlightClassName` are the container's own API, `axis` and `gapClick` pass through to the hook; row classes are upstream's `rowClass` with per-axis variants; the two scripted-cursor demos are dropped |
227
- | `Motion` | `registry/default/lib/springs.ts` + `app/docs/motion/page.tsx` | `primitives/motion/index.tsx` | `Motion` is local demo code (FF ships none): it plays one tier's enter spring and exit tween on its children, adding `defaultShow`, `sameExit` and `reducedMotion`; `spring` / `exitFallbackMs` re-exported from the vendored `springs.ts`; the ball-on-track and fake-modal visuals become show/hide of arbitrary children |
228
- | `Morph` | — (local; see [Morph sources](#morph-sources)) | `primitives/morph/index.tsx` | a docs stage like `Motion`: a trigger and a panel playing one `from` × `effect` pair over `lib/use-morph.ts`; static `.Part` (= `MorphPart`); also documents the liquid indicators (`lib/goo-indicator.tsx`) |
229
- | `Code` | — (local; FF has no code item) | `primitives/code/index.tsx` | sugar-high tokens colored by the `--syntax-*` tokens, one surface step above its substrate; also the docs chrome's Code slot |
230
- | `Craft` | — (local; after the before/after pairs on fluidfunctionalism.com/docs/skill) | `primitives/craft/index.tsx` (+ `demos.tsx`) | a docs stage: a bad and a good version side by side with a one-line verdict each; the bad sides live in `demos.tsx` and break one rule each on purpose, the good sides are this package's items |
231
- | `Separator` | — (local) | `primitives/separator/index.tsx` | Base UI Separator (role and orientation for assistive tech) on the `border` token; `orientation` |
232
- | `Skeleton` | — (local) | `primitives/skeleton/index.tsx` (+ `skeleton.css`) | a `--skeleton` fill pulsing in opacity on `--duration-loop` (also under reduced motion); one block sized by its caller, or `rows` on the size ladder (`bordered` frames them); hidden from assistive tech |
233
-
234
- #### components
235
-
236
- | Item | Upstream | Local | Specific modifications |
237
- |---|---|---|---|
238
- | `Accordion` | `registry/base/accordion.tsx` | `components/accordion/index.tsx` | open state runs through `useControllableState` (see [Behavior additions](#behavior-additions)); standalone `Accordion` accepts `highlight` and passes it to its items as their default; the panel morphs out of its row (a shape grows from the press point into the item, content clipped by it, layout height on its bottom edge; the `"item"` tint is that shape melted into the row through `GooFilter`), `effect` / `tier` on `Accordion.Content`; the group's hover highlight and focus ring snap with reflowed rows; statics `.Group/.Item/.Trigger/.Content`; local Trigger `icon` / `weightShift`, Content `contentClassName`; `Accordion.Trigger` takes `render` / `asChild` (`lib/slot.ts`) |
239
- | `AlertDialog` | — (local) | `components/overlays/alert-dialog/index.tsx` (+ `pending-demo.tsx`) | Base UI AlertDialog root (always modal, no outside-press dismissal) over Dialog's own parts and `DialogState`, so it morphs like Dialog; `AlertDialog.Content` drops the ✕ by default; statics as Dialog's; `AlertDialog.Action` (promise-aware confirm: Button `loading`, every close blocked via `details.cancel()` while pending, closes on resolve, `onError` on reject; a controlled `pending` makes a plain `onClick` close once `pending` goes true and back to false) and `AlertDialog.Cancel` (Close as a ghost Button, disabled while pending); `pending-demo.tsx` is the docs stage; `onOpenChange(open, details)` with Base UI's change details (an action's own close reports `'imperative-action'`) |
240
- | `Avatar` | — (local) | `components/avatar/index.tsx` | Base UI Avatar (image loading status, the fallback's `delay`); one control tall (36 / 28px compact), `shape` circle or square; a 1px inset image edge after FF's media outline (`outline-image-edge`); the image fades in on the fast tier; statics `.Image/.Fallback` |
241
- | `Badge` | `registry/default/badge.tsx` | `components/badge/index.tsx` | `variant` re-declared (it came from cva's `VariantProps` upstream); changes animate: a new label or variant springs the width (inner content span, `spring.moderate`) while the label blur-crossfades, a new color fades, the dot scales in and out; "Changes" example over a local `change-demo.tsx` stage; `badgeColors`, `badgeVariants` and the size aliases moved to `variants.ts` (server-callable) and re-exported; local variant `outline` (the dot badge's neutral hairline without the dot; `color` has no effect) |
242
- | `Button` | `registry/base/button.tsx` | `components/button/index.tsx` | `variant`/`disabled`/`children` re-declared; extra Sizes / Active / As-child / Loading morph examples; `loading` folds the surface into a circle around the spinner and back (`spring.moderate`, box unchanged), label and spinner crossfade, `aria-busy`, the disabled dim fades; "Loading morph" example over a local `loading-demo.tsx` stage; also serves modo's chrome Button (`shell.Button`); `buttonVariants` and the size aliases moved to `variants.ts` (server-callable) and re-exported; local variants for shadcn-style hosts: `outline` (renders as `tertiary`), `destructive` / `success` (their `-strong` hue as text on a translucent wash that deepens on hover and press, never a solid fill), `link` (underlined foreground text on the control height); size `xs` → `compact`; the `primary` variant reads the `--primary*` / `--shadow-button-primary` hooks (the same ink look by default); `buttonVariants` resolves the size aliases and takes `surface` (fill/ring/wash/hover/press/`aria-disabled` as root classes, for an anchor host); `loading` keeps focus (`focusableWhenDisabled`; `asChild` sets `aria-disabled` and blocks clicks) |
243
- | `Calendar` | — (local, on react-day-picker) | `components/inputs/date-time/calendar/index.tsx` (+ `use-month-window.ts`) | DayPicker props pass through (as shadcn's Calendar); styled through `classNames` and custom `Month` / `Day` / `DayButton` (no react-day-picker stylesheet); one scrolling list of months rendered as a 25-month window that moves as you scroll; a pinned weekday row, muted weekends, today's dot; FF's fills (the pick `bg-foreground text-background` like the primary button, a range `bg-active`, its preview `bg-hover`); month and year columns that mark the month being read and jump on click, before or after the days (`columnsSide`), turning into strips when narrow; `extraColumns` / `extraColumnsSide` for the date picker's time; `columnLabels`; a named `CalendarProps` and a `ReactElement` return; the month window's edge margin is capped, so a list with no height of its own no longer loops |
244
- | `Card` | `registry/default/card.tsx` | `components/card/index.tsx` | `next/link` → plain anchors (stretched card link, `CardButton`'s `href` form); statics `.Group/.Header/.Title/.Description/.Action/.Content/.Footer/.Media/.Image/.Eyebrow/.Feature/.Button/.Divider`; local `border="outlined"` on a standalone card (the outlined group's hairline frame; inside a group the group decides); local `Card.Divider` (a full-bleed hairline between the card's parts, vertical in an inline card; the Separator primitive); local Title `as`, Content `bodyText` |
245
- | `Checkbox` (upstream `CheckboxItem`), `Checkbox.Group` (upstream `CheckboxGroup`) | `registry/base/checkbox-group.tsx` | `components/inputs/checkbox/index.tsx` | renamed; the row stands alone too (own state from `defaultChecked`, `onCheckedChange`, own hover and focus ring, `size`); rows numbered by the group (`lib/row-index.tsx`), so `index` is optional; uncontrolled mode + group-level callback; item `checked`/`onToggle` optional, falling back to group context; arrow-key focus guarded for `noUncheckedIndexedAccess`; shared `useSelectionRuns`, picks melt and split through the goo; `label` optional, any node (named via `aria-labelledby`); without a label and outside a group the checkbox is a bare box, Base UI's Checkbox.Root itself (`id` / `<label htmlFor>`, `aria-label`, `name` / `value` / `required` for forms), keeping its border when checked; `indeterminate` / `checked="indeterminate"` shows the icon set's `minus`, swapped with the self-drawing check in one cell; `disabled` dims a row and takes it out of the group's hover and arrow keys |
246
- | `ColorPicker` | `registry/default/color-picker.tsx` | `components/inputs/color-picker/index.tsx` | `@/registry/radix/{slider,tooltip}` → the Base siblings `../slider` / `../../overlays/tooltip`; `noUncheckedIndexedAccess` guards on regex captures, `rgb()`/`hsl()`/`oklch()` parts, `itemRects[i]` and the Slider's array value; static `.Popover`; uncontrolled support was already upstream (verified, kept); `ColorPicker.Popover` (goo on `spring.goo`; `from` / `effect` / `hideSource` / `tier`) and the format menu morph out of their triggers, replacing the motion wrappers and the ignored `actionsRef`; the color types and math (`parseColor`, `buildParsed`, conversions, formatting) in `variants.ts` (server-callable) and re-exported; `ColorPicker.Popover` takes `disabled`, `readOnly`, `rootClassName` and `removeLabel`; swatches and tiles keep a hairline above the color |
247
- | `Combobox` | `registry/base/combobox.tsx` | `components/inputs/combobox/index.tsx` | root de-generified (the parser needs a plain function plus a same-file `interface ComboboxProps`): items gained an index signature, `value`/`defaultValue` are `string \| string[]` and `onValueChange` is a union of the two handler shapes; `ComboboxValue<Multiple>` still exported; `creatable` added; `React.*` type refs replaced by named type imports; statics `.Input/.Chips/.Content/.List/.Item/.Empty`; the popup morphs out of the field (morph layer, goo on `spring.goo`; `from` / `effect` / `hideSource` / `tier` on `Combobox.Content`), replacing the `scaleY` wrapper and the `actionsRef` deferred unmount; `loading` (the chevron blurs into a `loader-circle` spinner, a status row under the list, the empty message held back) and `loadingLabel`; controlled query (`inputValue` / `defaultInputValue` / `onInputValueChange`); `filter={null}` shows the items as given; `readOnly` (Base UI's, plus the field box's read-only state; no clear or chip ✕); controlled popup (`open` / `defaultOpen` / `onOpenChange`); `footer` on `Combobox.Content` (a node or `({ close, query }) => node`); object items' `label` may be any node (unclipped in rows and chips) with `textValue` to filter, fill the field and name the chip; fields read the surrounding Field's invalid state (`invalid` prop, `error` forces it), `hideTrigger`, a root `labels` object (`open` / `clear` / `remove(label)` / `placeholder`), and `onInputValueChange(value, details)` forwarding Base UI's change details |
248
- | `Command` | — (local) | `components/overlays/command/index.tsx` | Base UI Autocomplete rendered inline in Dialog's panel (`position="top"`, no ✕), morphing from its trigger with goo; grouped/flat command data filtered by label + keywords; one fluid highlight follows Base UI's highlight; ⌘K/Ctrl+K `hotkey` (one palette answers a press); fresh palette per open; statics `.Trigger/.Content/.Palette/.Shortcut`; `CommandList`/`CommandListRoot` exported for Search; `onOpenChange(open, details)` with Base UI's change details (`reason`, `event`, `cancel()`) |
249
- | `ContextMenu` | — (local; see [Morph sources](#morph-sources)) | `components/overlays/context-menu/index.tsx` | Base UI ContextMenu (right click, long press) with the morph layer growing from the press point (`from="pointer"` default, goo on `spring.goo`); rows are Dropdown's `MenuItem`, `Dropdown.Label`, `Dropdown.Separator` with fluid hover; `ContextMenu.Item` adds `shortcut`; `size` on the root; statics `.Trigger/.Content/.Item/.Label/.Separator` |
250
- | `Dialog` | `registry/base/dialog.tsx` | `components/overlays/dialog/index.tsx` | `DialogProps` and `DialogContentProps` fully re-declared (the slot props now come from `lib/slot.ts`); statics attached as expando properties (`Dialog.Trigger = …`), so `<Dialog.Content>` types without a cast; FF's "With a sidebar" example replaced by "Surfaces inside a dialog" (written before the Sidebar was ported); the panel morphs out of its trigger (morph layer, goo on `spring.goo`; `from` / `effect` / `hideSource` / `tier` on `Dialog.Content`), the backdrop fades with the morph's progress, the root holds the open state and scopes `Morph.Part` pairs; `onOpenChange(open, details)` hears Base UI's change details and can `cancel()` (one-argument handlers still work), and `createDialogChangeDetails` builds them for the library's own changes; `disablePointerDismissal` on the root; `Dialog.Content` types and forwards `initialFocus` / `finalFocus` and takes `popupClassName` (merged after the popup's width) |
251
- | `Dropdown` | `registry/base/dropdown.tsx` | `components/overlays/dropdown/index.tsx` | uncontrolled selection and uncontrolled search filtering (below); `items[next].focus()` guarded; statics `.Menu/.Trigger/.Content/.Item/.Label/.Separator/.Search/.Empty`; FF's "Create from the query" section skipped — adding a row to the list is real consumer state; the popup menu morphs out of its trigger (morph layer, goo on `spring.goo`; `from` / `effect` / `hideSource` / `tier` on `Dropdown.Content`), replacing the `scaleY` wrapper and the ignored `actionsRef`; popup rows hand activation to the Menu item's `onClick` so Enter / Space pick; shadcn DropdownMenu parity: children rows with an optional index (`lib/row-order.tsx`), `inset` / `shortcut` rows, a cancelable `onSelect(event)`, `asChild` on the trigger, a keyboard focus ring, `keepMounted`, and the parts in `menu-parts.tsx` (see the headers); `render`/`asChild` and `textValue` on rows; Menu `onOpenChange(open, details)` and `modal`; Content/SubContent `finalFocus`, modo-side `initialFocus`, `collisionPadding`, `container`, `positionerClassName`, popup HTML attributes; Content `alignOffset`, `collisionBoundary` |
252
- | `DatePicker`, `DateRangePicker`, `TimePicker`, `DurationPicker`, `MonthPicker` | — (local; props after shadcn's date picker and utegsk/ui's pickers) | `components/inputs/date-time/<id>/index.tsx` (+ the group's `picker-shell.tsx`, `time-columns.tsx`) | a field on the field ladder whose panel morphs out of it with Combobox's options (goo by default; `from` / `effect` / `hideSource` / `tier`, in place with `effect="morph"` + `hideSource`), or a bottom `Sheet` under 640px; one hour column with AM/PM on a 12-hour clock; `columnsSide` / `timeColumnsSide`; the panel header types the value in the locale's formats; `value` / `defaultValue` / `onValueChange` with `null` for empty — a `Date`, react-day-picker's `DateRange`, `"HH:mm"`, a date-fns `Duration`, a month's first day; `locale` is a react-day-picker locale throughout; `picker-shell.tsx` takes an `editor`, `triggerLabel` and `readOnly`; `picker-shell.tsx` also takes `controlRef` / `controlProps` / `formValues` / `required` (visually hidden inputs for native forms) and exports `PickerControlProps` (form + aria props every picker forwards); every picker is a `forwardRef` with `readOnly`, `labels`, string `locale`; `DateRangePicker` adds `editable`, `withTime`, `hourCycle`, `hidden`, `startName` / `endName`, `startInputProps` / `endInputProps`; `controlProps` reaches an editable field's input after its defaults (`autoComplete`, `inputMode`); the range panel header wraps with `withTime` |
253
- | `DatePicker` | — (local; the masked input after utegsk/ui's `MaskedDateInput`) | `components/inputs/date-time/date-picker/index.tsx` (+ `masked-date-input.tsx`) | `editable` masked input in the field (Escape restores the last real date), `labels`, `formatDate`, `actions`, `readOnly`, string values (date-only strings read as local days) with an invalid state; `hidden`, `required` (no deselect), `unselectable` (`masked-date-input.tsx` takes `clearable`) |
254
- | — | `registry/default/menu-item.tsx` | `components/overlays/dropdown/menu-item.tsx` | a row with no `checked` derives it from a self-managed panel and toggles the panel's state; `sourceIndex` carries the authored index so selection survives filter re-indexing; `label` and `index` optional (`children` rows numbered in document order), `inset`, `shortcut`, cancelable `onSelect(event)`; checkbox and radio rows report to the panel for the merged selection background; `render`/`asChild` and `textValue` on rows |
255
- | — | — (local) | `components/overlays/dropdown/menu-parts.tsx` | `Dropdown.Group`, the `Dropdown.Shortcut` re-export, value-keyed `Dropdown.CheckboxItem`, `Dropdown.RadioGroup` / `Dropdown.RadioItem`, `Dropdown.Sub` / `.SubTrigger` / `.SubContent` (a submenu morphs out of its row), and `useMenuPanel`, the state both popups share (keyboard focus ring, the submenu trigger's pinned highlight, value-checked backgrounds); `Sub` / `SubContent` take `finalFocus`, modo-side `initialFocus`, `collisionPadding`, `container`, `positionerClassName` and popup HTML attributes |
256
- | — | `registry/default/dropdown-search.tsx` | `components/overlays/dropdown/dropdown-search.tsx` | `filter` mode: `value`/`onValueChange` optional, the field reads and writes the query held by the panel (`DropdownFilterContext`) |
257
- | `Copy` (upstream `InputCopy`) | `registry/default/input-copy.tsx` | `components/copy/index.tsx` | renamed, out of the inputs group; `@/registry/radix/tooltip` → `../overlays/tooltip`; `useRef<ReturnType<typeof setTimeout> \| null>(null)` (React 18 overloads); defaults spelled into the prop prose; the tooltip comment's "Radix" reads "Base UI"; the copied state morphs: the glyph's two sheets melt through the goo filter into a status-tinted disc behind the check (✕ on failure) and split back; local `chip` and `glyph` variants, `labels`, live-region announcement; ref typed `HTMLElement` |
258
- | `Field` | — (local) | `components/inputs/field/index.tsx` | Base UI Field with no form library: `.Label` / `.Description` / `.Error` / `.Control`, inset to the text in the field box (`lib/field-variants.ts`); the field's state (invalid, also from native validity; disabled, read-only, required) reaches any control on `useFieldBox` through `FieldStateContext` |
259
- | `FileDropzone` | — (local) | `components/inputs/file-dropzone/index.tsx` (+ `file-row.tsx`, `variants.ts`, `upload-demo.tsx`) | a label around a visually hidden file input, joined to Base UI's Field; hands picked files over and keeps none (no upload logic); drag verdicts accept / partial (some will be skipped) / reject, refusing only drags where nothing can pass; `required` announced, not native; `.Row` (`FileRow`: status and progress); the pure accept / size / count helpers (`acceptsFile`, `dragVerdict`, `sortFiles`, `formatFileSize`) in `variants.ts`; `upload-demo.tsx` is the docs stage; rest `<label>` props and `style` on the root |
260
- | `Input`, `Label`, `InputGroup` | `registry/default/input-group.tsx` | `components/inputs/input/index.tsx` | `InputField` split into `Input` (the ringed box, standalone: own hover outside a group, `invalid`, `size`) and `Label` (now its own item `components/inputs/label/index.tsx`, re-exported from `inputs/input`; rendered through `Field.Label` in a field), composed back by `InputGroup.Field`; item renamed `input`, `Input` the default export; uncontrolled mode (`InputHTMLAttributes`' own `defaultValue` omitted in favour of the local one); static `.Field`; `startAdornment` / `endAdornment`, `readOnly`, `required` (both also from a surrounding `Field`), `InputAction` (an icon button inside the box) and `InputAdornment`; a `type` swap keeps the caret and selection |
261
- | `Label` | `registry/default/input-group.tsx` | `components/inputs/label/index.tsx` | split out of InputField; invalid, size; data-disabled dims it; re-exported from inputs/input |
262
- | `InputMessage` | `registry/default/input-message.tsx` | `components/AI/input-message/index.tsx` | uncontrolled twins for value, files, queue and status (below); `FilePreviewTile` turned into a `forwardRef` (it exits inside `<AnimatePresence mode="popLayout">`, which measures through a ref); guards on `queue[0]`, `history[i]`, `suggestions[i]` and the `moveQueued` swap; FF's Playground section skipped and the surrounding transcript dropped (`ChatMessage` is not ported) |
263
- | `NavigationMenu` | — (local) | `components/navigation/navigation-menu/index.tsx` | Base UI NavigationMenu; one shared flyout morphing from its trigger (anchored to the List, frame springs to each content's size, content crossfades by activation direction); fluid hover on strip and panels; one keyboard ring per panel; `Indicator` is a GooIndicator under the open/current item; Root takes ref and nav attributes; Trigger and Content `asChild` keep the child's element and ref |
264
- | `NumberInput` | — (local) | `components/inputs/number-input/index.tsx` | Base UI NumberField on the field box (`useFieldBox`), steppers as field actions inside the ring, Intl `format`, scrub; `inputProps` spread last on the `<input>`; `onValueChange(value, details)` |
265
- | `Pagination` | — (local, from the skill's authoring.md template) | `components/navigation/pagination/index.tsx` | pages strip (GooIndicator + fluid hover) or jump-to-page field; edges; page-size Select; labels as props |
266
- | — | `registry/default/file-thumbnail.tsx` | `components/AI/input-message/file-thumbnail.tsx` | the lazy `import("pdfjs-dist")` is kept as-is — verified against modo's esbuild settings, it lands in a ~790 kB chunk fetched only when a PDF is attached; the worker still comes from jsDelivr, so no bundler-side worker config is needed; the `@next/next/no-img-element` eslint-disable dropped |
267
- | `Popover` | — (local; after beUI's gooey popover and motion-primitives' morphing popover, see [Morph sources](#morph-sources)) | `components/overlays/popover/index.tsx` | Base UI Popover with the morph layer (goo by default); `openOnHover` on the trigger; statics `.Trigger/.Content/.Title/.Description/.Close`; `Popover.Content` forwards `anchor` (the morph's source when it is an element), `alignOffset`, `collisionPadding`, `collisionBoundary`, `initialFocus`, `finalFocus`; `onOpenChange(open, details)` with Base UI's change details (`cancel()`) |
268
- | `PreviewCard` | — (local; after beUI's gooey popover, see [Morph sources](#morph-sources)) | `components/overlays/preview-card/index.tsx` | Base UI PreviewCard with the morph layer (goo from the link on `spring.goo`); `delay` / `closeDelay` / `render` on the trigger, a token-styled link by default; `from` without `'pointer'`; statics `.Trigger/.Content` |
269
- | `Progress` | — (local) | `components/progress/index.tsx` (+ `progress.css`, `step-demo.tsx`) | Base UI Progress; the determinate fill is a full-width bar slid with `translateX` on `spring.moderate` (after FF's CarouselDots fill, never scaled); with no `value` a segment sweeps the track; `.Spinner` draws Button's figure-eight loading glyph; both loops on `--duration-loop` (`progress.css`); `step-demo.tsx` is the docs stage |
270
- | `Radio` (upstream `RadioItem`), `Radio.Group` (upstream `RadioGroup`) | `registry/base/radio-group.tsx` | `components/inputs/radio/index.tsx` | renamed; rows numbered by the group (`lib/row-index.tsx`), so `index` is optional; uncontrolled index and value modes; group context carries a `selectIndex` setter every item calls, so items need no `selected`/`onSelect`; arrow-key focus guarded; selected background is a `GooIndicator`; `label` optional, any node; a `Radio` without one is a bare circle, Base UI's Radio.Root (picked by `value`, `id` / `<label htmlFor>`, keeping its border when picked) laid out freely inside a value-mode group, which then draws no rows and leaves the arrow keys to Base UI; `disabled` on a row, or on the group (which dims as a whole); the group's `name` / `required` reach Base UI's RadioGroup for forms |
271
- | `Search` | — (local; after beUI's morphing search, see [Morph sources](#morph-sources)) | `components/inputs/search/index.tsx` | pill or icon button springing its own width in place (`spring.slow`), growing over its neighbors (`align`); with `items`, Autocomplete suggestions ooze out of the field via the morph layer (goo on `spring.goo`, `effect`/`tier`) with Command's rows; Escape closes → clears → collapses; blur collapses when empty; `shortcut`; `<search>` landmark + form, `onSubmit` |
272
- | `Select` | `registry/base/select.tsx` | `components/inputs/select/index.tsx` | members re-declared one per line (the parser drops members whose type spans lines); upstream's uncontrolled `defaultValue` verified and kept rather than rerouted through `useControllableState`; expando statics `.Trigger/.Content/.Item/.Group/.Label/.Separator`; the popup morphs out of its trigger (morph layer, goo on `spring.goo`; `from` / `effect` / `hideSource` / `tier` on `Select.Content`), replacing the `scaleY` wrapper and the `actionsRef` deferred unmount; `Select.Item`'s `index` is optional: rows take their place in document order (`lib/row-order.tsx`), inside groups, conditionals and maps, and the checked row is found by its own index; `textValue` for typeahead; a node label is shown as is (unclipped) in the rows and, through Base UI's `items`, in the trigger; `Select.Value` part, with `Select.Trigger` children replacing its value slot; `side` / `align` / `sideOffset` on `Select.Content`; `triggerVariants` in `variants.ts` (server-callable) and re-exported; the keyboard ring is the shared `lib/focus-ring.tsx`; `open` / `defaultOpen` / `onOpenChange(open, details)` (the 300ms pick ack runs only while uncontrolled); `Select.Content` `alignOffset` / `collisionPadding` / `finalFocus` / rest HTML attributes; `Select.Trigger` / `Select.Item` `render` / `asChild`; `Select.Trigger` `wrapperClassName`; `Select.Value` and `Select.Group` forward ref |
273
- | `Sheet` | — (local; replaces beUI's bottom sheet and drawer, see [Morph sources](#morph-sources)) | `components/overlays/sheet/index.tsx` | Base UI Drawer (swipe to dismiss, snap points, `Drawer.Viewport` for the swipe) with the morph growing from the sheet's own edge; a swipe-dismissed sheet slides on off its edge from the release point (the morph's `exit`); `side`, `snapPoints`, `defaultSnapPoint`; Dialog's parts and `DialogState` (Base UI's Drawer parts are Dialog's); statics as Dialog's plus `.Provider` / `.Indent`; `onOpenChange(open, details)` with Base UI's change details (`reason`, `event`, `cancel()`); `disablePointerDismissal` on the root; `Sheet.Content` takes `side` (overrides the root's, the swipe follows), `initialFocus` / `finalFocus` and `popupClassName` (merged after `PLACEMENT`) |
274
- | `Sidebar` | `registry/base/sidebar.tsx` (+ `registry/default/sidebar-core.tsx`, `sidebar-menu.tsx`; `app/globals.css` `.scroll-divider`) | `components/navigation/sidebar/index.tsx` (+ `sidebar-core.tsx`, `sidebar-menu.tsx`, `sidebar.css`) | the mobile sheet is the DS's `Sheet` (goo from its edge, swipe to dismiss) instead of a Dialog with a framer slide; no collapsed peek: `openOnHover` on the provider opens the sidebar in flow while the pointer is between its edge and the far side of a trigger beside it, the trigger switching between open and on hover (`panel-*-dashed` glyphs added to the icon context); the active row backgrounds are `GooIndicator`s and the hover highlight the liquid `FluidHoverHighlight`; uncontrolled selection (`value` on the buttons, `value` / `defaultValue` / `onValueChange` on `Sidebar`) and collapsible rows (`Sidebar.MenuItem collapsible`, below); statics `.Provider/.Trigger/.Rail/.Inset/.Input/.Header/.Content/.Footer/.Separator/.Group/.GroupLabel/.GroupAction/.GroupActions/.GroupContent/.Menu/.MenuItem/.MenuButton/.MenuAction/.MenuActions/.MenuBadge/.MenuSkeleton/.MenuSub/.MenuSubItem/.MenuSubButton` through a `SidebarComponent` cast; `fontVariationSettings` → `weight-*`, `text-[Npx]` → type roles, hex focus ring → `ring-focus-ring`, `duration-80\|160\|240` → tiers; `sidebarMenuButtonVariants` and the `SIDEBAR_*` constants in `variants.ts` (server-callable; `variants.ts` files are bunup entries); `inert` through `lib/inert.ts` |
275
- | `Slider` | `registry/base/slider.tsx` | `components/inputs/slider/index.tsx` | `var(--color-accent)` → `var(--accent)` (no `--color-*` aliases here); uncontrolled support on the public wrapper, with both engines still fully controlled; `SliderProps extends Omit<SliderEngineProps, "value" \| "onChange">`; React 18 ref types (`MutableRefObject`); indexed reads of the value/step/pip arrays asserted; `aria-label` names the thumbs ahead of the visible `label`; `orientation="vertical"` (compact engine, min at bottom) and `onValueCommit` (both engines; drag end, keyboard step, value edit) |
276
- | `Switch` | `registry/base/switch.tsx` | `components/inputs/switch/index.tsx` | uncontrolled support; every in-body read goes through the resolved `isChecked` and a `toggle()` that also calls `onToggle`; the thumb is a `GooIndicator` in Base UI's Thumb (stretches as it travels), dragged x held in state; local `description` (muted line, `aria-describedby`) and `trackSide`; local `Switch.Group`: switches as settings rows (track at the end) in one outlined fieldset, after an outlined `Card.Group` (shared hairlines dropped around the fluid hover highlight), rows numbered by the group; `label` optional, any node; without one (outside a group) the switch is the bare track, Base UI's Switch.Root, which toggles itself (click, keyboard, a `<label htmlFor>`) through `onCheckedChange`, with the thumb drag on the track and the toggle that follows a drag swallowed; `name` / `value` / `required` reach Base UI's hidden input in both modes |
277
- | `Table` | `registry/default/table.tsx` | `components/table/index.tsx` (+ `sort-demo.tsx`) | statics `.Header/.Body/.Row/.Head/.Cell`; `TableProps` / `TableRowProps` exported; local additions: Footer, Caption, Empty, sortable Head (`sortDirection`/`defaultSortDirection`/`onSort`), `stacked` + Cell `label` (stacked cells `items-start`), `containerClassName`; unindexed body rows numbered in document order (`lib/row-order`); weight by section; header-only border melt; stacked values in foreground |
278
- | `Tabs` | `registry/base/tabs.tsx` | `components/navigation/tabs/index.tsx` | `defaultSelectedIndex` added as the index-mode twin of the existing `defaultValue`; indicator and hover pill are `GooIndicator`s (the hover pill returns to the active tab as it fades); statics `.List/.Item/.Panel`; `Tabs.Item` node `label` (inert ghost copy), `href` link tabs |
279
- | `TabsSubtle` | `registry/base/tabs-subtle.tsx` | `components/navigation/tabs-subtle/index.tsx` | uncontrolled mode; panels may be authored inside the root (below); the tab list's ref write goes through `MutableRefObject`; selected and hover pills are `GooIndicator`s; statics `.Item/.Panel` |
280
- | `Textarea` | — (local; Input's multi-line twin) | `components/inputs/textarea/index.tsx` | Base UI `Field.Control` rendered as a `<textarea>`; the field ladder from `lib/field-classes.ts`; padding sized so one row matches the control height; grows from `minRows` to `maxRows` (InputMessage's measure), then scrolls; `value` / `defaultValue` / `onChange`; `readOnly` / `required` (also from a surrounding `Field`); neither `value` nor `onChange` means a DOM-held uncontrolled `<textarea>` (ref-readable, form-reset aware) |
281
- | `ThinkingIndicator` | `registry/default/thinking-indicator.tsx` | `components/AI/thinking-indicator/index.tsx` | upstream prop JSDoc kept (it already matches the FF API table); the `.shimmer-text` rule it rides lives in `base.css`; local `variant="goo"` (three dots merging and splitting through `GooFilter`, plain label; default stays `shimmer`); reduced motion also follows MotionConfig |
282
- | `Toast` | — (local; after Sileo, see [Morph sources](#morph-sources)) | `components/overlays/toast/index.tsx` (+ `manager.ts`, `global-demo.tsx`) | Base UI Toast (queue, timers, swipe, announcements) with Sileo's pill melting into a body through the shared `GooFilter`; autopilot expand/collapse, six states on the `--status-*` tokens, promise toasts; `Toast` is the provider + viewport, `Toast.Trigger` shows one, `useToast()` the in-tree API (plus `toasts`, `update`, `dismiss`); `manager.ts` holds one module-level Base UI `createToastManager()` exported as the global `toast()` (`.success/.error/.warning/.info/.loading/.promise/.update/.dismiss`, each returning `{ id, update, dismiss }`), queuing calls made before a provider subscribes (dropped on the server); `<Toast manager={toast}>` renders them (`manager` takes any source with a `subscribe`); ReactNode title/description, `icon` as a component or node, `action` as `{ label, onClick }` or a node, `duration` as an alias of `timeout`; a loading toast stays until its type changes, then leaves on the timeout; status glyphs via `useIcons()` instead of direct lucide imports; `global-demo.tsx` is the docs stage; `Toast.Action` / `Toast.Close` (Base UI's parts as compact Buttons, `render` / `asChild`) for custom action nodes |
283
- | `Tooltip` | `registry/base/tooltip.tsx` | `components/overlays/tooltip/index.tsx` | `className`/`children` docs filled in; statics `.Provider` / `.PortalContainer`; the slide + fade replaced by the morph layer (goo from the trigger on `spring.goo`, `from` / `effect` / `tier` props; `followCursor` tooltips fade); a hand-off between grouped tooltips skips the morph (Base UI's `data-instant`); local compound parts `TooltipRoot` (`open` / `defaultOpen` / `onOpenChange`, `delay` or `delayDuration`, `closeDelay`, `followCursor`), `TooltipTrigger` (`render` or Radix-style `asChild`; drops the slot's `nativeButton`) and `TooltipContent` (`side`, `align`, `sideOffset`, `alignOffset`, `collisionPadding`, `positionerClassName`, morph options, `render` / `asChild` for the label, rest props on the popup), also as statics `.Root .Trigger .Content`; `Tooltip` without `content` is the root, and the flat form gains `open` / `defaultOpen` / `align` / `alignOffset` / `collisionPadding` / `delay` / `closeDelay`; `TooltipProvider` takes `delay` / `closeDelay` / `timeout` and Radix's `delayDuration` / `skipDelayDuration` (Base UI name wins; a negative skip clamps to 0) |
284
-
285
- #### blocks
286
-
287
- | Item | Upstream | Local | Specific modifications |
288
- |---|---|---|---|
289
- | `SidebarApp` | the app-sidebar.tsx and page.tsx FF's preset generator emits for `sa1FQfCxH6` (`lib/preset/sidebar-install.ts` @ `c367a0d066bc10e663b3d269bc40539ea8417b25`, later than the pin: the generator postdates it) | `blocks/sidebar-app/index.tsx` (+ `nav-data.ts`) | the selected thread rides `Sidebar`'s `value` and shows in the topbar; the switcher keeps its own pick (`defaultCheckedIndex`); the footer's raw icon buttons are the ghost `Button`; `variant`, `side`, `openOnHover`, `contained` props |
290
- | — | `registry/blocks/sidebar-workspace-header.tsx` | `blocks/sidebar-app/workspace-header.tsx` | `fontVariationSettings` → `weight-semibold`, `text-[13px]` / `text-[10px]` → `text-body` / `text-micro-compact`; `defaultCheckedIndex` passed through; the peek-only trigger over the tile dropped |
291
- | — | `registry/blocks/sidebar-user-footer.tsx` | `blocks/sidebar-app/user-footer.tsx` | `text-[13px]` → `text-body` |
292
- | — | `registry/blocks/sidebar-app/search-field.tsx` | `blocks/sidebar-app/search-field.tsx` | `text-[11px]` → `text-micro` |
293
- | — | `registry/blocks/sidebar-app/inset-topbar.tsx` | `blocks/sidebar-app/inset-topbar.tsx` | the trigger's peek-time fade dropped (the sidebar opens on hover in flow, so the trigger stays) |
294
- | — | `registry/default/lib/sidebar-menu-grid.ts` | `blocks/sidebar-app/menu-grid.ts` | the width reads `--anchor-width` only; the `-ml-1` shift dropped (it would move the morph surface's content off its background) |
295
-
296
- `Select` in `docs/chrome.tsx` is not an item: modo's docs chrome renders its Select slot
297
- with a flat `value` / `onChange` / `options` contract
298
- (`lib/src/lib/slots.tsx`), and this adapter maps it onto
299
- `Select.Trigger` / `Select.Content` / `Select.Item` so the chrome runs on the
300
- design system's own Select. The
301
- `components/inputs/select` item keeps the upstream API untouched.
302
-
303
- `DocsNav` in `docs/chrome.tsx` is the chrome's Sidebar slot, pinned as
304
- `shell.Sidebar` (by name alone modo would adopt the documented `Sidebar`, an
305
- app shell that needs its provider). Each aside is an inset `Sidebar` with its
306
- own provider, and `docs/chrome.css` turns the content between them into the inset
307
- card (the lib's grid columns become `auto`, so they follow the sidebars' width
308
- springs). Each provider has `openOnHover`, and its `Sidebar.Trigger` sits in
309
- the card's corner: the trigger, `[` for the nav and `]` for the panel, switch
310
- a side between open and on hover, and on hover it opens once the pointer is
311
- in the column under the trigger (so a browser's own edge hover sidebar stays
312
- out of the way). `DocsNav` owns those keys, so a demo sidebar in the content keeps them only
313
- while it has focus. Below md each side is a drawer; the panel starts on hover
314
- below xl. A section of links is a collapsible `Sidebar.Group` with one
315
- `Sidebar.Menu`, so the current page, the TOC's current heading and the hover
316
- highlight melt from link to link; a panel section (Theme) keeps its control
317
- under the group label.
318
-
319
- `ThemeSwitcher` in `docs/chrome.tsx` is not an item either: it is the `Theme` entry in
320
- `modo.config.ts` `panel.items`, a `Select` of Light / Dark / System (each row
321
- with its icon, the trigger showing the active one) that reads and sets
322
- `window.__uiTheme` and re-reads it on `ui:themechange`. All switching logic lives in the pre-paint controller
323
- described under **Tailwind → UnoCSS**, so the control holds no theme state of
324
- its own. `demo/scripts/run-design-systems.ts` appends its own `Switcher` panel
325
- item to whatever a design system declares, so both show up under the runner.
326
-
327
- The chrome's own elements (the corner triggers, the panel section's gutter) are
328
- styled in `docs/chrome.css` through `data-modo-ui` attributes, not utility
329
- classes: nothing in `docs/` needs a UnoCSS or Tailwind scan, so a host with
330
- either generator loads the same file. `Button` and `Link` are pinned too, so a
331
- design system with items of those names but another prop shape is not matched
332
- by name (modo would warn on every start).
333
-
334
- ### The docs chrome, for another design system
335
-
336
- A design system documented with modo (an `@utegsk/ui`-style package that
337
- depends on `@justanarthur/modo-ui`) gets the same sidebars, inset card layout,
338
- panel and Theme switcher as this site by pointing its `modo.config.ts` at the
339
- shipped module. A `shell` / `panel` value may be a package specifier (the
340
- viewer resolves it from the project root through the package's `exports`, the
341
- `source` file first), which needs an `@justanarthur/modo` release after
342
- 0.9.0-canary.0; with an older viewer keep a one-line local re-export instead
343
- (`export * from '@justanarthur/modo-ui/docs'` in a `docs/shell.tsx`, and point
344
- the slots at `./docs/shell.tsx#DocsNav`).
101
+ A subtree with its own class keeps that scheme (a dark preview card on a light
102
+ page).
345
103
 
346
- ```ts
347
- // modo.config.ts
348
- import { defineConfig } from '@justanarthur/modo/config'
349
-
350
- export default defineConfig({
351
- name: 'My DS',
352
- css: './docs.css',
353
- vite: './vite.mjs',
354
- shell: {
355
- Button: '@justanarthur/modo-ui/docs#Button',
356
- Link: '@justanarthur/modo-ui/docs#Link',
357
- Select: '@justanarthur/modo-ui/docs#Select',
358
- Icon: '@justanarthur/modo-ui/docs#Icon',
359
- Sidebar: '@justanarthur/modo-ui/docs#DocsNav',
360
- },
361
- panel: { items: [{ label: 'Theme', component: '@justanarthur/modo-ui/docs#ThemeSwitcher' }] },
362
- })
363
- ```
104
+ To re-brand, override tokens after the package's stylesheet, on the same
105
+ selector the tokens use (`.light` / `.dark` subtrees re-declare them). Give a
106
+ color both sides with `light-dark()`:
364
107
 
365
108
  ```css
366
- /* docs.css: the package stylesheet (or base.css with your own utilities), then the chrome */
367
- @import "@justanarthur/modo-ui/styles.css";
368
- @import "@justanarthur/modo-ui/docs/chrome.css";
109
+ :root,
110
+ .light,
111
+ .dark {
112
+ --brand: oklch(0.65 0.19 150);
113
+ --brand-hover: oklch(0.6 0.19 150);
114
+ --background: light-dark(oklch(0.99 0.005 150), oklch(0.2 0.01 150));
115
+ --font-sans: "Geist Variable", ui-sans-serif, system-ui, sans-serif;
116
+ }
369
117
  ```
370
118
 
371
- ```js
372
- // vite.mjs: plain JS, Node loads it as is. Add your own plugins (Tailwind, UnoCSS) beside docsTheme.
373
- import { docsTheme } from '@justanarthur/modo-ui/docs/vite'
119
+ The tokens live in five groups: colors (`--background`, `--foreground`,
120
+ `--muted-foreground`, `--accent`, `--brand`, `--destructive`, `--status-*`,
121
+ `--syntax-*`, …), typography (`--font-sans`, `--text-<role>`,
122
+ `--weight-*`), motion (`--duration-*`), radius and spacing. The surface ladder
123
+ (`--surface-1…8`, `--shadow-1…8`) re-points per scheme. The docs'
124
+ Foundations pages list every one with its value.
125
+
126
+ ## Component API
127
+
128
+ The same conventions run through every component:
129
+
130
+ - **State both ways.** Values are `value` / `defaultValue` / `onValueChange`
131
+ (`checked` / `defaultChecked` / `onCheckedChange` on Checkbox and Switch),
132
+ and `onValueChange` gets the value, not an event: `Input`, `Textarea` and
133
+ `Slider` included. Overlays and other popups take `open` / `defaultOpen` /
134
+ `onOpenChange`. Leave the value prop out and the component keeps its own
135
+ state.
136
+ - **Sizes.** `size` is `default` (36px) or `compact` (28px); Button adds
137
+ `icon` and `icon-compact`. Leave it out and a component follows the nearest
138
+ `SizeProvider`, so one `<SizeProvider size="compact">` makes a whole
139
+ region dense, menus included.
140
+ - **Forms.** Checkbox, `Radio.Group`, Switch, Select, Combobox, Slider,
141
+ NumberInput, ColorPicker and the date and time pickers take `name` and
142
+ submit their value with the surrounding form; Input and Textarea are native
143
+ fields. Text fields, Select and Combobox take `readOnly` and `required`.
144
+ - **Fields.** Wrap a control in `Field` for a label, a description and an
145
+ error (`Field.Label`, `.Description`, `.Error`); the control takes the
146
+ field's `invalid`, `disabled`, `readOnly` and `required` unless it sets its
147
+ own.
148
+ - **Overlays.** Content parts that anchor to a trigger (Popover, PreviewCard,
149
+ Dropdown, Select, Combobox) take `side`, `align`, `sideOffset` and
150
+ `container`, plus the morph options `from`, `effect`, `hideSource` and
151
+ `tier`. `Tooltip.PortalContainer` portals every overlay inside it into
152
+ another element (a preview frame, a shadow root). `Dialog.Content` and
153
+ `AlertDialog.Content` take `width`: `sm` (400px), `lg` (540px) or `xl`
154
+ (880px). `Tooltip` takes `open` / `defaultOpen` to pin it, `side`, `align`
155
+ and `container`, and `Tooltip.Trigger` / `Tooltip.Content` for a trigger of
156
+ your own. `Popover.Content` also takes `anchor`, `alignOffset`, the
157
+ `collision*` props and `initialFocus` / `finalFocus`.
158
+ - **Tabs** take `variant`: `segmented` (a track with an elevated indicator,
159
+ the default) or `subtle` (a borderless strip with a pill).
160
+ - **Date pickers.** `disabled` turns the field off; `disabledDays` takes
161
+ react-day-picker matchers for the days that can't be picked.
162
+ `valueType="string"` makes DatePicker and DateRangePicker take and report
163
+ ISO strings instead of `Date`s; `labels` replaces their texts; DatePicker's
164
+ `editable` lets the field be typed into.
374
165
 
375
- export default config => {
376
- config.plugins = [...(config.plugins ?? []), docsTheme({ storageKey: 'my-ds-theme' })]
377
- return config
378
- }
166
+ ```tsx
167
+ <Select name="plan" defaultValue="pro" onValueChange={setPlan}>…</Select>
168
+ <Input size="compact" onValueChange={setQuery} />
169
+ <DatePicker disabledDays={{ before: new Date() }} />
170
+ <Field invalid>
171
+ <Field.Label>Email</Field.Label>
172
+ <Input type="email" />
173
+ <Field.Error>Enter a valid email.</Field.Error>
174
+ </Field>
379
175
  ```
380
176
 
381
- - `chrome.css` also loads by itself, as the stylesheet beside the slot module,
382
- when modo bundles `@justanarthur/modo-ui/docs` from its source; the explicit
383
- `@import` fixes where it sits in your cascade and is the one to rely on.
384
- - `docsTheme` puts `.light` / `.dark` on `<html>` before first paint and
385
- exposes `window.__uiTheme` for `ThemeSwitcher`; `storageKey` (default
386
- `modo-ui-theme`) keeps two sites on one origin apart.
387
- - The panel's narrow-screen behavior (below xl the panel is a drawer, opened on
388
- hover or with `]`, never a strip above the content) comes with `chrome.css`.
389
- A stylesheet that re-implements the layout instead of importing it can
390
- recreate the lib's `grid-template-rows: auto` strip: a viewport-tall blank
391
- row with the Theme select behind it.
392
- - `lucide-react` (the `Icon` slot) is already a dependency of the package;
393
- the docs entry adds no other. `@justanarthur/modo-ui` itself must be a
394
- dependency of the host: modo resolves the specifier from the project root.
395
-
396
- ## Tier mapping
397
-
398
- The tiers mirror the FF docs navigation. FF's "System" pages become
399
- `primitives/`; its "Components" become `components/`. Its sidebar preset
400
- becomes the one block.
401
-
402
- | Tier | Item | Upstream source | FF docs page |
403
- |---|---|---|---|
404
- | primitives | `surface` (Elevated, `.Provider`, `useSurface`) | `lib/elevated.tsx` + `lib/surface-context.tsx` | surfaces |
405
- | primitives | `scroll-area` (ScrollArea) | `base/scroll-area.tsx` | scrollbars |
406
- | primitives | `sizes` (SizeProvider) | `lib/size-context.tsx` | sizes |
407
- | primitives | `fluid-hover` (FluidHover) | `hooks/use-fluid-hover.ts` + `fluid-hover-highlight.tsx` | fluid-hover |
408
- | primitives | `motion` (Motion) | `lib/springs.ts` | motion |
409
- | primitives | `code` (Code) | — (local, sugar-high) | — |
410
- | primitives | `morph` (Morph) | — (local, `lib/use-morph.ts`) | — |
411
- | primitives | `craft` (Craft) | — (local, bad/good pairs) | skill (before/after) |
412
- | primitives | `separator` (Separator), `skeleton` (Skeleton) | — (local) | — |
413
- | components | accordion, button, combobox, dialog, dropdown, select, slider, switch, tabs, tabs-subtle, tooltip | `registry/base/<id>.tsx` | same slug |
414
- | components | `checkbox` (Checkbox, `.Group`), `radio` (Radio, `.Group`) | `registry/base/checkbox-group.tsx`, `radio-group.tsx` | checkbox-group, radio-group |
415
- | components | badge, card, color-picker, input-message, table, thinking-indicator | `registry/default/<id>.tsx` | same slug |
416
- | components | `copy` (Copy) | `registry/default/input-copy.tsx` | input-copy |
417
- | components | `input` (Input, Label, InputGroup) | `registry/default/input-group.tsx` | input-group |
418
- | components | alert-dialog, command, context-menu, popover, preview-card, search, sheet, toast | — (local, see [Morph sources](#morph-sources)) | — |
419
- | components | calendar, date-picker, date-range-picker, time-picker, duration-picker, month-picker (group `inputs/date-time`) | — (local, on react-day-picker) | — |
420
- | components | avatar, progress, field, number-input, file-dropzone, navigation-menu, pagination | — (local) | — |
421
- | components | sidebar | `base/sidebar.tsx` + `default/sidebar-core.tsx` + `default/sidebar-menu.tsx` | sidebar |
422
- | blocks | `sidebar-app` (SidebarApp) | the preset generator's output + `blocks/sidebar-*` | sidebar, preset `sa1FQfCxH6` |
423
-
424
- Button lives in `components/` to mirror the FF docs, and `modo.config.ts`
425
- points `shell.Button` at it explicitly (an explicit path skips modo's tier
426
- check). The chrome renders its icon buttons as `<Button variant="ghost"
427
- size="icon-sm">`, which works because `icon-sm` is upstream's legacy alias for
428
- `icon-compact`.
429
-
430
- Compound components export their root by default, with the parts attached
431
- as statics (`Select.Item`, `Accordion.Trigger`, …). Upstream's named exports
432
- are kept as well.
433
-
434
- ## Omitted
435
-
436
- These are not ported: ThinkingSteps, CommandMenu, ChatMessage and
437
- AskUserQuestions. CommandMenu is the FF docs site's own chrome, which modo's
438
- shell already provides; ThinkingSteps, ChatMessage and
439
- AskUserQuestions are the agent-chat composites, left out of this port's scope.
440
- No ported file imports any of them.
441
-
442
- The files only they, or the FF docs site's nav, use are left out too:
443
- `mobile-drawer`, `nav-item`, `nav-menu`, `lib/theme-context.tsx` (the
444
- `ThemeSwitcher` panel item and docs/vite.ts's pre-paint controller take its
445
- place) and the blocks other than the sidebar's (`queued-stack`,
446
- `dialog-sidebar`). Inside kept files, the same rule removed
447
- `SURFACE_HOVER_BG`, `SURFACE_HOVER_SHADOW` and `surfaceHoverClasses` from
448
- `surface-classes.ts` (only the Sidebar docs' callout cards used them; the
449
- callouts are not ported).
450
-
451
- The same goes for the docs-site-only CSS in `app/globals.css`: `.xl-fade-*`,
452
- `.inview-fade-block`, `.bento-*` and
453
- `.shiki`, plus the Tailwind directives, the self-hosted Inter `@font-face`
454
- and the Radix-only scroll-lock margin fix (`body[data-scroll-locked]`).
455
-
456
- `surface.css` does keep the inset shadow variants (`--shadow-light-2-inset`,
457
- `--shadow-light-3-inset` and the per-scheme `--shadow-2-inset` /
458
- `--shadow-3-inset` aliases), but no ported item consumes them and
459
- `preset.ts` maps no utility to them.
460
-
461
- ## Tailwind → UnoCSS
462
-
463
- `uno.config.ts` uses `presetWind4` (UnoCSS's Tailwind v4 preset) and
464
- `preset.ts` (the theme and token utilities the package ships) with
465
- `outputToCssLayers`. `vite.ts` adds the UnoCSS Vite plugin to modo's Vite
466
- config. `scripts/build-css.ts` runs the same config over `dist/` for the
467
- prebuilt `styles.css`, and turns `preset.ts` into `tailwind.css`.
468
-
469
- - **Dark mode.** `dark: 'class'` produces `.dark .dark\:x`, the same "inside a
470
- `.dark` ancestor" contract as FF's `@custom-variant dark (&:is(.dark *))`.
471
- modo ships no theme of its own, so `docsTheme` (`docs/vite.ts`, applied by
472
- `vite.ts`) injects a small controller into
473
- `index.html` (`transformIndexHtml`, `head-prepend`). Before first paint it
474
- puts `light` or `dark` on `<html>` — the stored preference, or the OS one
475
- under `system` — which is also what flips every `light-dark()` token through
476
- `color-scheme`. It exposes `window.__uiTheme` (`get` / `set`), persists the
477
- choice in `localStorage` under `modo-ui-theme`, and fires `ui:themechange`
478
- on every apply, including when the OS flips underneath `system`.
479
- - **Load order.** The same plugin prepends `import 'virtual:uno.css'` to
480
- modo's `\0virtual:modo-config-css` module, so UnoCSS's
481
- `@layer properties, theme, base, default` statement lands before
482
- `global.css` (and the `base.css` it imports) and fixes the order of the
483
- layer its `@layer base` rules join.
484
- `vite.ts` is loaded by Node with type stripping, so it may only use erasable
485
- TypeScript, names the `.ts` extension of the one relative module it imports
486
- (`./docs/vite.ts`) and hands `uno.config.ts` to UnoCSS by absolute path.
487
- `docs/vite.ts` ships built (`dist/docs/vite.js`): Node never strips types
488
- from a file under `node_modules`.
489
- - **Colors.** Theme colors point at the CSS variables directly (for example
490
- `accent: 'var(--accent)'`, `surface.1..8`). wind4 applies opacity modifiers
491
- to `var()` colors with `color-mix(in srgb, …)`, so `bg-accent/12` works on
492
- the `light-dark()` tokens.
493
- - **Shadows.** `shadow-surface-N` maps to `var(--shadow-N)`, which is
494
- re-pointed per scheme in `surface.css`.
495
- - **Radius.** wind4's default scale stays (`rounded-lg` = 8px). shape-context
496
- pairs `rounded-lg` with 8px JS radii, so the scale must not follow
497
- `--radius`.
498
- - **Font.** `font.sans` repeats the literal family from
499
- `tokens/typography.css` rather than `var(--font-sans)`: wind4 emits theme
500
- keys as same-named variables, and a self-reference would be a cycle.
501
- - **Type roles.** `text-display|title|subtitle|body|caption` is a custom rule
502
- reading `var(--text-<role>)`.
503
- - **Transitions.** wind4's arbitrary `transition-[a,b]` only accepts CSS
504
- properties it knows. `stroke-width` (icon stroke on hover) and
505
- `font-variation-settings` (the Inter weight ladder) are added through
506
- `theme.property`.
507
- - **Layers.** UnoCSS declares `@layer properties, theme, base, default` and
508
- puts its reset in `base`. `base.css`'s `@layer base` rules join that layer
509
- after the reset, so utilities (in `default`) still win. This is the same
510
- arrangement as Tailwind's base/utilities split.
511
- - **Content.** UnoCSS scans `{lib,primitives,components,blocks}/**/*.{ts,tsx,mdx}`
512
- from disk (`content.filesystem`, and the same
513
- globs in `content.pipeline.include`, since the default pipeline skips
514
- `.ts`). Two reasons:
515
- - modo serves items pre-bundled, so the sources never pass through Vite's
516
- transform pipeline;
517
- - example code exists only in each item's `examples.mdx`.
518
-
519
- The class-name literal tables (`SURFACE_BG`, `sizeMap`, …) do the same job
520
- for UnoCSS's extractor that they do for Tailwind's scanner.
521
- - **Focus.** modo's structural `shell.css` draws an unlayered `*:focus-visible`
522
- outline. `global.css` reverts it with `outline: revert-layer` (and
523
- `outline-offset: revert-layer`), handing focus styling back to `@layer base`
524
- and the utilities, so FF's ring (1px `--focus-ring`) is the only one drawn.
525
-
526
- Every Tailwind idiom FF uses has a wind4 equivalent, among them:
527
- - named groups (`group-[.is-active]/row:`)
528
- - `has-data-[…]:`
529
- - arbitrary variants (`[[data-side=top]_&]:`, `[&>div[style]]:!block`)
530
- - `supports-[…]:`
531
- - arbitrary properties (`[text-box:…]`, `[--popup-enter-y:-4px]`)
532
- - typed arbitrary values (`ring-[color:…]`)
533
- - `duration-80`, `!h-auto`
534
- - `transition-[color,stroke-width]`, `transition-[font-variation-settings]`
535
- - `bg-accent/12` → `color-mix`, `shadow-surface-3`, `dark:bg-surface-2`
536
- - the type-role rule and wind4's unchanged `--radius-lg: 0.5rem`
537
-
538
- No upstream class string had to change. The current run covers 45 files and
539
- 3299 class tokens (561 unique), and all of them generate.
540
-
541
- ## `cn`
542
-
543
- `lib/utils.ts` exports `cn = createCn({ extend: { classGroups: {
544
- 'font-size': ['text-display', …] } } })` from `cn/config`. `cn` is a compiled
545
- drop-in for clsx + tailwind-merge with the same `extend` shape.
546
-
547
- The font-size extension keeps upstream's fix. Without it, `text-body` would
548
- be read as a text *color*, and `cn('text-body', 'text-muted-foreground')`
549
- would drop the size.
550
-
551
- ## Behavior additions
552
-
553
- Base UI components work both controlled and uncontrolled. The FF wrappers
554
- that were controlled-only gain a `default*` prop, backed by
555
- `lib/use-controllable-state.ts`: a component is controlled while its
556
- value prop is not `undefined`, and it reports every change through its
557
- callback either way. Where FF only had per-item callbacks, a group-level one
558
- was added and the item's own state props became optional.
559
-
560
- | Item | Controlled prop | Added uncontrolled prop | Added change callback |
561
- |---|---|---|---|
562
- | Accordion, Accordion.Group | `value` | `defaultValue` (semantics fixed, below) | — (`onValueChange` now also fires uncontrolled) |
563
- | Checkbox | `checked` (now optional) | `defaultChecked` (standalone) | `onCheckedChange` |
564
- | Checkbox.Group | `checkedIndices` (now optional) | `defaultCheckedIndices` (`Set` or array) | `onCheckedIndicesChange` |
565
- | Dropdown, Dropdown.Content | `checkedIndex`, `checkedIndices` | `defaultCheckedIndex`, `defaultCheckedIndices` | `onCheckedIndexChange`, `onCheckedIndicesChange` |
566
- | Input, InputGroup.Field | `value`, `onChange` (now optional) | `defaultValue` | — |
567
- | InputMessage | `value`, `files`, `queue`, `status` | `defaultValue`, `defaultFiles`, `defaultQueue`, `defaultStatus` | `onValueChange` optional; `onStatusChange` added |
568
- | Radio.Group | `selectedIndex`, `value` | `defaultSelectedIndex`, `defaultValue` | `onSelectedIndexChange` (`onValueChange` now also fires uncontrolled) |
569
- | Slider | `value`, `onChange` (now optional) | `defaultValue` | — |
570
- | Switch | `checked`, `onToggle` (now optional) | `defaultChecked` | `onCheckedChange` |
571
- | Sidebar | `value` (new: the row whose `value` is selected) | `defaultValue` | `onValueChange` |
572
- | Sidebar.MenuItem `collapsible` | `open` (new: its sub-menu; upstream's docs held it in page state) | `defaultOpen` | `onOpenChange` |
573
- | Tabs | `value`, `selectedIndex` | `defaultSelectedIndex` (`defaultValue` is upstream's) | — |
574
- | TabsSubtle | `selectedIndex`, `onSelect` (now optional) | `defaultSelectedIndex` | — |
575
-
576
- Already uncontrolled upstream and left on their own internal state (none of
577
- these go through `useControllableState`): Select `defaultValue` — checked
578
- explicitly, see its file header — ColorPicker and ColorPicker.Popover
579
- (`defaultValue`, `defaultFormat`, `defaultFormatOpen`, `defaultOpen`),
580
- Combobox `defaultValue`, Tabs `defaultValue`, and the `defaultOpen` of
581
- Dropdown.Menu. Dialog's `open` / `defaultOpen` now go through
582
- `useControllableState`, because the morph reads the open state.
583
-
584
- Notable local behavior changes beyond the `default*` props:
585
-
586
- | Item | Change |
177
+ ## Next.js and React Server Components
178
+
179
+ - Every module with state, effects, handlers or browser APIs opens with
180
+ `'use client'`, kept at the top of each built chunk, so the components work
181
+ from Server Components (Next.js App Router) as client components.
182
+ - `@justanarthur/modo-ui/lib/{utils,springs,size-scale,shape-classes,field-classes}`
183
+ and `components/{button,badge,inputs/file-dropzone}/variants` carry no
184
+ `'use client'`, so a Server Component can call `cn`, read the class tables,
185
+ build a link with `buttonVariants` or check a file with `acceptsFile`. The
186
+ components and the context and hook subpaths are client modules; each
187
+ context is one instance, shared by the barrel, the items and the subpaths.
188
+ - In a Server Component, use the named parts (`CardHeader`, `DialogContent`,
189
+ `TabsList`, `SidebarMenuButton`, …) rather than the dotted form
190
+ (`Card.Header`): React can't read a property off a client module from the
191
+ server. Both are exported; the dotted form works in client components.
192
+ - `pdfjs-dist` is an optional peer, used only for PDF thumbnails in
193
+ `InputMessage` (`npm install pdfjs-dist`). It loads lazily on the first PDF
194
+ attachment, and fetches its worker from `cdn.jsdelivr.net`. Without it, a
195
+ PDF attachment shows the file icon and a console warning. Webpack-based
196
+ builds (Next.js) resolve the dynamic import at build time, so there install
197
+ `pdfjs-dist` or alias it to `false`.
198
+
199
+ ## Hooks for your own components
200
+
201
+ The motion and layout systems are exported, so components of your own move
202
+ and stack the way these do (the docs' Morph, Motion, Sizes and Surface pages
203
+ show them):
204
+
205
+ | Export | What it does |
587
206
  |---|---|
588
- | Accordion | Upstream treated the presence of `onValueChange` as "controlled", so an uncontrolled accordion with a listener never opened. Now `value` alone controls, and `defaultValue` seeds an accordion that still reports changes. |
589
- | Radio.Group | The group context carries a `selectIndex` setter that every item selection calls (after its own `onValueChange` / `onSelect`), so items need no `selected` / `onSelect` of their own. |
590
- | Checkbox.Group | The group context carries the checked set plus a setter; an item's toggle always reports to the group as well. |
591
- | TabsSubtle | Panels may now be written inside `<TabsSubtle>`: the root partitions its children, keeps the tabs inside the tab list and renders the panels as its siblings right after it (the root element *is* the `role="tablist"`, so panels cannot nest in it). A panel with no `selectedIndex` / `idPrefix` reads both from context, the prefix falling back to a `useId()` one; a panel rendered outside `<TabsSubtle>` still takes them as props. |
592
- | Dropdown | `Dropdown.Search` with `filter` hands the query to the panel, which drops the `Dropdown.Item` rows whose `label` doesn't match, re-indexes the survivors for fluid hover, and shows `Dropdown.Empty` only when nothing matched — the work the controlled form asks the consumer to do. Selection stays keyed on the authored index (`sourceIndex`), so it survives re-indexing. |
593
- | Combobox | `creatable` offers the create row with no callback and the component keeps the items it makes (merged into `items`, deduped by value), so a combobox can grow its own list; `onCreate` is unchanged and still wins when it returns an item. The root is also no longer generic — see the file map. |
594
- | InputMessage | Attachments are enabled by `onFilesChange` **or** `defaultFiles`; the queue by `onQueueChange` **or** `defaultQueue` (still only alongside a status). With the status uncontrolled the Stop control is offered even without `onStop` and flips the status to `"idle"` itself, which is the edge that auto-dispatches the head of the queue. An uncontrolled draft and file list clear themselves after `onSend`. |
595
- | Card | `next/link` is gone: the stretched card link and `CardButton`'s `href` form render plain anchors. Examples use inline `data:image/svg+xml` gradients instead of real image files. |
596
- | Dialog, Select, Combobox | Statics are attached as expando properties (`Dialog.Trigger = …`) rather than through `Object.assign`, so TypeScript infers them without a cast and `check-items` can see them. |
597
-
598
- ## Dependency deltas (vs upstream `package.json`)
599
-
600
- | Upstream | Here | Why |
601
- |---|---|---|
602
- | `tailwindcss`, `@tailwindcss/postcss` ^4 | `unocss` 66.10.5 (pinned) | UnoCSS instead of Tailwind |
603
- | `clsx`, `tailwind-merge` | `cn` ^0.3.0 | Compiled drop-in |
604
- | `framer-motion` ^12 + `motion` ^12 | `motion` ^13.4.0 | One package; imports use `motion/react` |
605
- | `@base-ui/react` ^1.4.1 | `@base-ui/react` 1.4.1 (exact) | FF styling relies on its `--anchor-width`, `--available-height` and `data-side` hooks |
606
- | `lucide-react` ^0.564 | `lucide-react` ^1.47.0 | Workspace version; `icon-context`'s `size`/`strokeWidth` widened to `number \| string` for it |
607
- | `react` / `react-dom` ^19 | ^18.3 | The workspace pins React 18. React 19's ref typings are adapted per file: `MutableRefObject` casts where a forwarded ref is written, `useRef<T \| null>(null)` instead of the 1-arg null form, and `FilePreviewTile` turned into a `forwardRef` (React 19 passes `ref` as a plain prop; React 18 warns and drops it). |
608
- | self-hosted `InterVariable.ttf` | `@fontsource-variable/inter` ^5.3.0 (`opsz.css`) | npm-distributed. The opsz axis is needed by the `--weight-*` ladder. |
609
- | `pdfjs-dist` ^5.7.284 | same | InputMessage PDF thumbnails. It bundles under modo's esbuild as a lazy ~790 kB chunk; the worker is loaded from `cdn.jsdelivr.net`, as upstream does. |
610
- | `class-variance-authority` ^0.7.1 | same | |
611
- | `next` (`next/link`, `next/image` lint) | — | No Next.js here |
612
- | — | `@justanarthur/modo` (workspace) | The design system's own host |
613
- | — | `sugar-high` ^2.5.1 | Tokenizer for the local `primitives/code` item |
614
- | — | `react-day-picker` ^10.0.2, `date-fns` ^4.4.0 | The calendar under the date pickers, and its date math, formats and locales (`react-day-picker/locale`); date-fns is declared because the pickers import it directly |
615
- | — | `vite` ^5.4, `esbuild` ^0.20, `typescript` ^5.4, `@types/react(-dom)` ^18.3 (dev) | `vite` ^5.4 makes UnoCSS's peer reuse modo's Vite 5. The others serve the scripts and `tsc`. |
616
-
617
- Every import is declared here, because bun's isolated linker only exposes
618
- declared packages.
619
-
620
- ## Docs and examples
621
-
622
- What modo's item reader (`lib/src/lib/docs.ts`, `tsdoc.ts`) and example compiler
623
- (`lib/src/lib/example.ts`) need, and how this package answers it:
624
-
625
- - **The item is the file's `export default`**, followed through re-exports
626
- to its declaration — `function X(…)`, a `forwardRef<El, XProps>(…)`, or any
627
- component-typed value. (The workarounds for the old text parser stay: ScrollArea's
628
- spelled-out `HTMLDivElement`, Combobox's de-generified root.)
629
- - **Props are read with the TypeScript compiler** from the render function's
630
- parameter, the `forwardRef` props type or the component's type, inherited
631
- members included (`extends`, `Omit`, `Pick`, intersections, across files).
632
- React's DOM attributes and other libraries' typings (Base UI,
633
- react-day-picker) stay out unless re-declared, so a prop meant for the table
634
- is declared with a description. The Default column takes the destructured
635
- default, else `@default`, else a closing ``Defaults to `x`.`` sentence.
636
- - **Examples live in `examples.mdx`** next to the item, included by the
637
- TSDoc's `@example {@include ./examples.mdx}`: a `# <FF section title>`,
638
- an optional caption, then one JSX block (or a fenced code block for code to
639
- read). Expressions are plain JS (no `as const`), and multi-line JSX text
640
- stays inline (modo unwraps MDX's paragraphs inside examples).
641
- - **Examples are hook-free JSX.** Nothing runs a component body, so
642
- interactivity in the docs comes from the `default*` props above instead of
643
- `useState`.
644
- - **Imports are real**: the item is `./index`, other items are
645
- `../../<tier>/<id>` (one `../` more from or to a group folder), icons come from `lucide-react`. Every free identifier
646
- must be imported (or be an item name or a JS/DOM global), and every
647
- `Item.Part` used must really be attached to that item.
648
-
649
- Each item follows its FF docs page: the TSDoc holds the one-liner, a concept
650
- paragraph and the list of statics; `examples.mdx` holds one `# <FF section
651
- title>` example per docs section. Playground and API Reference sections are never ported (the API
652
- tables become the prop docs instead). Other per-item deviations:
653
-
654
- | Item | Docs deviation |
655
- |---|---|
656
- | Button | Extra Sizes / Active / As-child examples, for API-table props the FF page has no section for. |
657
- | Dialog | "With a sidebar" replaced by "Surfaces inside a dialog" (a Select popover lifting off the dialog's own level) — the same point about composing inside an `xl` panel, with items this port ships. |
658
- | Sidebar | Layouts split into three examples; "Callouts" (docs-only cards), "Inside a dialog", the "No icon rail" prose (folded into the TSDoc) and "Functional and perfectly aligned" (an alignment-guides overlay) skipped; "Mobile drawer" added. Frames pass `mobileBreakpoint={0}` like FF's, so a rail stays a rail inside them. |
659
- | SidebarApp | One block page for FF's preset playground: the preset itself (collapsed), open, open on hover, floating on the right. |
660
- | Dropdown | "Create from the query" skipped: adding a row to the list is real consumer state, which an uncontrolled panel cannot stand in for. |
661
- | InputMessage | Playground skipped; the transcript around the Attachments / Send Handler demos dropped, since `ChatMessage` is not ported. |
662
- | FluidHover | The two scripted-cursor demos are dropped — they exist only to film the mechanism. |
663
- | SizeProvider | Live demos become static examples; the token-inspector overlay is dropped and the demo components are swapped for ones this port ships. |
664
- | Motion | The ball-on-track and fake-modal visuals become a show/hide of arbitrary children; component chips are plain text. |
665
- | Card | Images are inline `data:image/svg+xml` gradients. |
666
-
667
- ## Known limitations
668
-
669
- - The 22px mobile display size and the `html[data-size="compact"]` type-scale
670
- override are not carried over. Both are FF docs-site chrome. Compact type
671
- reaches components through `SizeProvider` / `useTypeScale()`.
672
- - Theme switching is docs-site glue, not a ported `ThemeProvider`: vite.ts's
673
- pre-paint controller and the `ThemeSwitcher` panel item. A `.light` /
674
- `.dark` class on a subtree still forces that scheme, which is what the
675
- forced-theme previews use.
676
- - `transition-[…]` with a CSS property outside wind4's list needs a
677
- `theme.property` entry in `preset.ts`.
678
- - Cross-item context (a `SizeProvider` example shrinking a Button, a surface
679
- level crossing from Dialog into Dropdown) depends on modo bundling the whole
680
- design system in **one** esbuild build with `splitting: true`, so a shared
681
- module exists once at runtime. The output lives in this package's
682
- `.modo-tmp/build`, which is keyed on the package and not on the port: two
683
- `modo dev` servers started in this directory share it. `run-design-systems.ts`
684
- avoids that by killing stray `modo dev` processes before it starts.
685
- - PDF thumbnails in InputMessage need network access: the pdfjs worker is
686
- fetched from `cdn.jsdelivr.net` on the first PDF attachment.
687
- - The inset shadow tokens in `surface.css` are dead weight today — they ship,
688
- but nothing in this package reads them.
689
-
690
- ## How to run
207
+ | `useMorph(open, origin, options)` | The morph engine: grows an overlay's surface from its source (the trigger, the press point, an edge) to its own box on a spring tier, with a liquid goo neck by default, and holds it through the exit. |
208
+ | `MorphSurface` | Renders a `useMorph` state: the goo-filtered shape, the surface's background and shadow, the content clipped by it. |
209
+ | `GooIndicator` | An indicator (a selection, a thumb) that travels between items' rects and melts like a drop of liquid on the way. |
210
+ | `useReduceMotion()` | The one reduced-motion read: the OS setting, or a `<MotionConfig reducedMotion>` asking for it. |
211
+ | `useControllableState(value, defaultValue, onChange)` | Controlled and uncontrolled state in one, Base UI style: controlled while `value` isn't `undefined`, reporting every change either way. |
212
+ | `spring`, `exitFallbackMs` | The spring tiers (`fast`, `moderate`, `slow`, `goo`), each with its quicker `exit` tween, for motion's `transition`. |
213
+ | `useSize`, `useSizeVariant`, `SizeProvider`, `SizeScope` | The size ladder: a component's classes for its step, the step a region chose, and the providers that set it (`SizeScope` only when a `size` is given). |
214
+ | `useSurface`, `useLift(offset)`, `SurfaceProvider`, `Elevated` | The surface ladder: the substrate level, the level `offset` above it (capped at 8), re-providing it, and a raised `div`. |
215
+ | `useFluidHover`, `FluidHoverHighlight`, `FluidHover` | The fluid hover highlight: the hook and its highlight for a custom list, or the container for a simple one. |
216
+ | `IconProvider`, `ShapeProvider` | Swap the icon set, or switch every radius between rounded and pill. |
217
+ | `useFieldBox`, `useFieldState` (`lib/field-box`) | The field ladder's box around a control of your own, and an enclosing `Field`'s state resolved against a control's own props. |
218
+ | `useToast()`, `toast` | Show toasts: `useToast()` inside a `Toast`, or the global `toast` anywhere once `<Toast manager={toast} />` is mounted (one per app). Both have `show`, `success`, `error`, `warning`, `info`, `loading`, `promise`, `update` and `close`. |
219
+ | `cn` | Class merging that knows the token utilities (`cn('text-body', 'text-muted-foreground')` keeps both). |
220
+
221
+ ## Documenting ui items in your own modo site
222
+
223
+ A [modo](https://github.com/justAnArthur/modo/tree/main/lib) site can list ui
224
+ items next to its own. Re-export one as an item:
691
225
 
692
- ```sh
693
- cd demo && bun scripts/run-design-systems.ts ui # http://127.0.0.1:5173
226
+ ```tsx
227
+ // components/button/index.tsx
228
+ export { default } from '@justanarthur/modo-ui/components/button'
694
229
  ```
695
230
 
696
- The runner kills stray `modo dev` processes, splices a temporary
697
- `.modo.config.ts` with the demo switcher panel, and assigns ports from 5173
698
- upward. To run the package on its own, without the switcher:
231
+ The package ships its TypeScript sources and each item's `examples.mdx` under
232
+ a `source` export condition, which modo reads and bundlers and Node skip
233
+ (they take `dist/`): the page gets the item's description, prop table and live examples,
234
+ bundled from those sources so they share one copy of each context. Load ui's
235
+ styles in the site's `css` (`@import "@justanarthur/modo-ui/styles.css";`);
236
+ the prebuilt sheet holds the components' utilities, so for the layout
237
+ utilities the examples add, point your Tailwind `@source` or UnoCSS `content`
238
+ at `node_modules/@justanarthur/modo-ui/{primitives,components,blocks}`.
699
239
 
700
- ```sh
701
- cd ui && MODO_PORT=5180 bun ../lib/dist/cli.js dev # after a lib build; ui has no modo bin
702
- ```
240
+ ## Credits
703
241
 
704
- ## How to verify
242
+ modo-ui is a port of [Fluid Functionalism](https://github.com/mickadesign/fluid-functionalism)
243
+ by Micka Touillaud / mickadesign, at commit
244
+ `b3587bdbd83fc66c2a6aae3817ffb856cb09260b`: MIT © 2026 Micka Touillaud, full
245
+ text in [`LICENSE.fluid-functionalism`](./LICENSE.fluid-functionalism). Every
246
+ vendored file keeps its provenance header.
705
247
 
706
- ```sh
707
- cd ui && bunx tsc -p . --noEmit
708
- ```
248
+ The morph layer takes techniques from three more MIT projects:
709
249
 
710
- modo reports parser and build problems itself, as `[modo:bundle]` lines in
711
- the dev server's output.
250
+ | Project | Repository @ commit | License | What it contributes |
251
+ |---|---|---|---|
252
+ | beUI | `github.com/starc007/ui-components` @ `de52f337e520e7ee37749b36eb1c32df86137bcb` | MIT © 2026 Saurabh Chauhan, [`LICENSE.beui`](./LICENSE.beui) | the gooey popover's rect interpolation, rounded-rect path, source cutout and goo filter; the morphing search (idea only) |
253
+ | motion-primitives | `github.com/ibelick/motion-primitives` @ `120f64f6ca60348e251f929e9c81f11ccbe45eda` | MIT © 2024 ibelick, [`LICENSE.motion-primitives`](./LICENSE.motion-primitives) | the morphing popover and morphing dialog (trigger growing into the panel, shared parts) |
254
+ | Sileo | `github.com/hiaaryan/sileo` @ `9793f844349983e140cf33cebbb8f51626d41407` | MIT, [`LICENSE.sileo`](./LICENSE.sileo) | the goo blur as a share of the surface radius; the gooey toast |
255
+
256
+ Sileo declares MIT in its `package.json` but ships no LICENSE file, so
257
+ `LICENSE.sileo` is the standard MIT text naming the repository's owner.
258
+ beUI's and motion-primitives' are copied verbatim. Only visuals come from
259
+ these projects: Base UI keeps all behavior (positioning, focus, dismissal,
260
+ hover and tap, scroll lock).
261
+
262
+ The package itself is MIT ([`LICENSE`](./LICENSE)). How the port was done
263
+ (the upstream → local file map, every local modification, the Tailwind →
264
+ UnoCSS translation) is in [`PORTING.md`](https://github.com/justAnArthur/modo/blob/main/ui/PORTING.md)
265
+ in the repository.