@justanarthur/modo-ui 0.5.0 → 0.6.0-canary.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 (461) hide show
  1. package/DESIGN.md +608 -0
  2. package/README.md +61 -39
  3. package/blocks/sidebar-app/examples.mdx +33 -0
  4. package/blocks/sidebar-app/index.tsx +218 -0
  5. package/blocks/sidebar-app/inset-topbar.tsx +25 -0
  6. package/blocks/sidebar-app/menu-grid.ts +26 -0
  7. package/blocks/sidebar-app/nav-data.ts +36 -0
  8. package/blocks/sidebar-app/search-field.tsx +48 -0
  9. package/blocks/sidebar-app/user-footer.tsx +67 -0
  10. package/blocks/sidebar-app/workspace-header.tsx +129 -0
  11. package/components/AI/input-message/examples.mdx +124 -0
  12. package/components/AI/input-message/file-thumbnail.tsx +173 -0
  13. package/components/AI/input-message/index.tsx +1383 -0
  14. package/components/AI/thinking-indicator/examples.mdx +27 -0
  15. package/components/AI/thinking-indicator/index.tsx +210 -0
  16. package/components/accordion/examples.mdx +148 -0
  17. package/components/accordion/index.tsx +1034 -0
  18. package/components/avatar/examples.mdx +95 -0
  19. package/components/avatar/index.tsx +129 -0
  20. package/components/badge/change-demo.tsx +29 -0
  21. package/components/badge/examples.mdx +120 -0
  22. package/components/badge/index.tsx +225 -0
  23. package/components/badge/variants.ts +73 -0
  24. package/components/button/examples.mdx +164 -0
  25. package/components/button/index.tsx +416 -0
  26. package/components/button/loading-demo.tsx +25 -0
  27. package/components/button/variants.ts +166 -0
  28. package/components/card/examples.mdx +212 -0
  29. package/components/card/index.tsx +1037 -0
  30. package/components/copy/examples.mdx +87 -0
  31. package/components/copy/index.tsx +482 -0
  32. package/components/inputs/checkbox/examples.mdx +83 -0
  33. package/components/inputs/checkbox/index.tsx +611 -0
  34. package/components/inputs/checkbox/select-all-demo.tsx +48 -0
  35. package/components/inputs/color-picker/examples.mdx +72 -0
  36. package/components/inputs/color-picker/index.tsx +1955 -0
  37. package/components/inputs/color-picker/variants.ts +401 -0
  38. package/components/inputs/combobox/examples.mdx +273 -0
  39. package/components/inputs/combobox/index.tsx +1436 -0
  40. package/components/inputs/combobox/remote-demo.tsx +101 -0
  41. package/components/inputs/date-time/calendar/examples.mdx +34 -0
  42. package/components/inputs/date-time/calendar/index.tsx +351 -0
  43. package/components/inputs/date-time/calendar/use-month-window.ts +163 -0
  44. package/components/inputs/date-time/date-picker/examples.mdx +166 -0
  45. package/components/inputs/date-time/date-picker/index.tsx +385 -0
  46. package/components/inputs/date-time/date-picker/masked-date-input.tsx +336 -0
  47. package/components/inputs/date-time/date-range-picker/examples.mdx +29 -0
  48. package/components/inputs/date-time/date-range-picker/index.tsx +217 -0
  49. package/components/inputs/date-time/duration-picker/examples.mdx +16 -0
  50. package/components/inputs/date-time/duration-picker/index.tsx +189 -0
  51. package/components/inputs/date-time/month-picker/examples.mdx +16 -0
  52. package/components/inputs/date-time/month-picker/index.tsx +190 -0
  53. package/components/inputs/date-time/picker-shell.tsx +395 -0
  54. package/components/inputs/date-time/time-columns.tsx +91 -0
  55. package/components/inputs/date-time/time-picker/examples.mdx +26 -0
  56. package/components/inputs/date-time/time-picker/index.tsx +166 -0
  57. package/components/inputs/field/examples.mdx +113 -0
  58. package/components/inputs/field/index.tsx +267 -0
  59. package/components/inputs/file-dropzone/examples.mdx +73 -0
  60. package/components/inputs/file-dropzone/file-row.tsx +201 -0
  61. package/components/inputs/file-dropzone/index.tsx +296 -0
  62. package/components/inputs/file-dropzone/upload-demo.tsx +67 -0
  63. package/components/inputs/file-dropzone/variants.ts +94 -0
  64. package/components/inputs/input/examples.mdx +135 -0
  65. package/components/inputs/input/index.tsx +494 -0
  66. package/components/inputs/input/password-demo.tsx +30 -0
  67. package/components/inputs/label/examples.mdx +67 -0
  68. package/components/inputs/label/index.tsx +85 -0
  69. package/components/inputs/number-input/examples.mdx +56 -0
  70. package/components/inputs/number-input/index.tsx +214 -0
  71. package/components/inputs/radio/examples.mdx +77 -0
  72. package/components/inputs/radio/index.tsx +636 -0
  73. package/components/inputs/search/examples.mdx +74 -0
  74. package/components/inputs/search/index.tsx +333 -0
  75. package/components/inputs/select/examples.mdx +218 -0
  76. package/components/inputs/select/index.tsx +862 -0
  77. package/components/inputs/select/variants.ts +32 -0
  78. package/components/inputs/slider/examples.mdx +127 -0
  79. package/components/inputs/slider/index.tsx +1725 -0
  80. package/components/inputs/switch/examples.mdx +94 -0
  81. package/components/inputs/switch/index.tsx +504 -0
  82. package/components/inputs/textarea/examples.mdx +88 -0
  83. package/components/inputs/textarea/index.tsx +161 -0
  84. package/components/navigation/navigation-menu/examples.mdx +109 -0
  85. package/components/navigation/navigation-menu/index.tsx +613 -0
  86. package/components/navigation/pagination/examples.mdx +64 -0
  87. package/components/navigation/pagination/index.tsx +395 -0
  88. package/components/navigation/sidebar/examples.mdx +319 -0
  89. package/components/navigation/sidebar/index.tsx +453 -0
  90. package/components/navigation/sidebar/sidebar-core.tsx +1408 -0
  91. package/components/navigation/sidebar/sidebar-menu.tsx +1495 -0
  92. package/components/navigation/sidebar/sidebar.css +74 -0
  93. package/components/navigation/sidebar/variants.ts +55 -0
  94. package/components/navigation/tabs/examples.mdx +89 -0
  95. package/components/navigation/tabs/index.tsx +494 -0
  96. package/components/navigation/tabs-subtle/examples.mdx +49 -0
  97. package/components/navigation/tabs-subtle/index.tsx +512 -0
  98. package/components/overlays/alert-dialog/examples.mdx +123 -0
  99. package/components/overlays/alert-dialog/index.tsx +258 -0
  100. package/components/overlays/alert-dialog/pending-demo.tsx +36 -0
  101. package/components/overlays/command/examples.mdx +113 -0
  102. package/components/overlays/command/index.tsx +416 -0
  103. package/components/overlays/context-menu/examples.mdx +56 -0
  104. package/components/overlays/context-menu/index.tsx +279 -0
  105. package/components/overlays/dialog/examples.mdx +144 -0
  106. package/components/overlays/dialog/index.tsx +366 -0
  107. package/components/overlays/dropdown/dropdown-search.tsx +395 -0
  108. package/components/overlays/dropdown/examples.mdx +294 -0
  109. package/components/overlays/dropdown/index.tsx +1168 -0
  110. package/components/overlays/dropdown/menu-item.tsx +464 -0
  111. package/components/overlays/dropdown/menu-parts.tsx +660 -0
  112. package/components/overlays/popover/anchored-demo.tsx +59 -0
  113. package/components/overlays/popover/examples.mdx +180 -0
  114. package/components/overlays/popover/index.tsx +315 -0
  115. package/components/overlays/preview-card/examples.mdx +61 -0
  116. package/components/overlays/preview-card/index.tsx +204 -0
  117. package/components/overlays/sheet/examples.mdx +89 -0
  118. package/components/overlays/sheet/index.tsx +247 -0
  119. package/components/overlays/toast/examples.mdx +68 -0
  120. package/components/overlays/toast/global-demo.tsx +72 -0
  121. package/components/overlays/toast/index.tsx +474 -0
  122. package/components/overlays/toast/manager.ts +193 -0
  123. package/components/overlays/tooltip/examples.mdx +106 -0
  124. package/components/overlays/tooltip/index.tsx +519 -0
  125. package/components/progress/examples.mdx +59 -0
  126. package/components/progress/index.tsx +174 -0
  127. package/components/progress/progress.css +49 -0
  128. package/components/progress/step-demo.tsx +27 -0
  129. package/components/table/examples.mdx +184 -0
  130. package/components/table/index.tsx +510 -0
  131. package/components/table/sort-demo.tsx +61 -0
  132. package/dist/base.css +100 -0
  133. package/dist/blocks/sidebar-app/index.js +39 -26
  134. package/dist/components/AI/input-message/index.js +22 -16
  135. package/dist/components/AI/thinking-indicator/index.js +9 -6
  136. package/dist/components/accordion/index.js +16 -13
  137. package/dist/components/avatar/index.d.ts +46 -0
  138. package/dist/components/avatar/index.js +18 -0
  139. package/dist/components/badge/index.d.ts +18 -11
  140. package/dist/components/badge/index.js +11 -7
  141. package/dist/components/badge/variants.d.ts +33 -0
  142. package/dist/components/badge/variants.js +10 -0
  143. package/dist/components/button/index.d.ts +53 -17
  144. package/dist/components/button/index.js +10 -6
  145. package/dist/components/button/variants.d.ts +39 -0
  146. package/dist/components/button/variants.js +8 -0
  147. package/dist/components/card/index.d.ts +16 -3
  148. package/dist/components/card/index.js +16 -11
  149. package/dist/components/copy/index.js +13 -9
  150. package/dist/components/inputs/checkbox/index.d.ts +28 -9
  151. package/dist/components/inputs/checkbox/index.js +17 -13
  152. package/dist/components/inputs/color-picker/index.d.ts +13 -13
  153. package/dist/components/inputs/color-picker/index.js +25 -18
  154. package/dist/components/inputs/color-picker/variants.d.ts +61 -0
  155. package/dist/components/inputs/color-picker/variants.js +28 -0
  156. package/dist/components/inputs/combobox/index.d.ts +60 -17
  157. package/dist/components/inputs/combobox/index.js +26 -18
  158. package/dist/components/inputs/date-time/calendar/index.js +14 -11
  159. package/dist/components/inputs/date-time/date-picker/index.d.ts +53 -11
  160. package/dist/components/inputs/date-time/date-picker/index.js +33 -25
  161. package/dist/components/inputs/date-time/date-range-picker/index.d.ts +3 -3
  162. package/dist/components/inputs/date-time/date-range-picker/index.js +32 -24
  163. package/dist/components/inputs/date-time/duration-picker/index.d.ts +3 -3
  164. package/dist/components/inputs/date-time/duration-picker/index.js +32 -24
  165. package/dist/components/inputs/date-time/month-picker/index.d.ts +3 -3
  166. package/dist/components/inputs/date-time/month-picker/index.js +31 -23
  167. package/dist/components/inputs/date-time/time-picker/index.d.ts +3 -3
  168. package/dist/components/inputs/date-time/time-picker/index.js +32 -24
  169. package/dist/components/inputs/field/index.d.ts +116 -0
  170. package/dist/components/inputs/field/index.js +28 -0
  171. package/dist/components/inputs/file-dropzone/index.d.ts +165 -0
  172. package/dist/components/inputs/file-dropzone/index.js +32 -0
  173. package/dist/components/inputs/file-dropzone/variants.d.ts +35 -0
  174. package/dist/components/inputs/file-dropzone/variants.js +12 -0
  175. package/dist/components/inputs/input/index.d.ts +95 -13
  176. package/dist/components/inputs/input/index.js +17 -9
  177. package/dist/components/inputs/label/index.d.ts +32 -0
  178. package/dist/components/inputs/label/index.js +11 -0
  179. package/dist/components/inputs/number-input/index.d.ts +84 -0
  180. package/dist/components/inputs/number-input/index.js +20 -0
  181. package/dist/components/inputs/radio/index.d.ts +20 -5
  182. package/dist/components/inputs/radio/index.js +15 -12
  183. package/dist/components/inputs/search/index.js +25 -18
  184. package/dist/components/inputs/select/index.d.ts +41 -11
  185. package/dist/components/inputs/select/index.js +27 -14
  186. package/dist/components/inputs/select/variants.d.ts +5 -0
  187. package/dist/components/inputs/select/variants.js +6 -0
  188. package/dist/components/inputs/slider/index.js +7 -5
  189. package/dist/components/inputs/switch/index.d.ts +8 -2
  190. package/dist/components/inputs/switch/index.js +14 -12
  191. package/dist/components/inputs/textarea/index.d.ts +4 -0
  192. package/dist/components/inputs/textarea/index.js +8 -6
  193. package/dist/components/navigation/navigation-menu/index.d.ts +114 -0
  194. package/dist/components/navigation/navigation-menu/index.js +40 -0
  195. package/dist/components/navigation/pagination/index.d.ts +73 -0
  196. package/dist/components/navigation/pagination/index.js +39 -0
  197. package/dist/components/navigation/sidebar/index.d.ts +44 -21
  198. package/dist/components/navigation/sidebar/index.js +41 -31
  199. package/dist/components/navigation/sidebar/variants.d.ts +25 -0
  200. package/dist/components/navigation/sidebar/variants.js +28 -0
  201. package/dist/components/navigation/tabs/index.d.ts +8 -2
  202. package/dist/components/navigation/tabs/index.js +14 -10
  203. package/dist/components/navigation/tabs-subtle/index.js +12 -10
  204. package/dist/components/overlays/alert-dialog/index.d.ts +121 -15
  205. package/dist/components/overlays/alert-dialog/index.js +22 -13
  206. package/dist/components/overlays/command/index.js +24 -17
  207. package/dist/components/overlays/context-menu/index.d.ts +33 -17
  208. package/dist/components/overlays/context-menu/index.js +27 -18
  209. package/dist/components/overlays/dialog/index.js +17 -12
  210. package/dist/components/overlays/dropdown/index.d.ts +257 -31
  211. package/dist/components/overlays/dropdown/index.js +42 -17
  212. package/dist/components/overlays/popover/index.d.ts +31 -9
  213. package/dist/components/overlays/popover/index.js +12 -9
  214. package/dist/components/overlays/preview-card/index.js +11 -8
  215. package/dist/components/overlays/sheet/index.js +18 -13
  216. package/dist/components/overlays/toast/index.d.ts +123 -47
  217. package/dist/components/overlays/toast/index.js +18 -10
  218. package/dist/components/overlays/tooltip/index.d.ts +113 -21
  219. package/dist/components/overlays/tooltip/index.js +15 -6
  220. package/dist/components/progress/index.d.ts +56 -0
  221. package/dist/components/progress/index.js +15 -0
  222. package/dist/components/table/index.d.ts +63 -8
  223. package/dist/components/table/index.js +19 -9
  224. package/dist/index.d.ts +2201 -736
  225. package/dist/index.js +223 -82
  226. package/dist/lib/date-locale.d.ts +14 -0
  227. package/dist/lib/date-locale.js +16 -0
  228. package/dist/lib/field-classes.d.ts +144 -0
  229. package/dist/lib/field-classes.js +40 -0
  230. package/dist/lib/field-variants.d.ts +47 -0
  231. package/dist/lib/field-variants.js +26 -0
  232. package/dist/lib/fluid-hover-highlight.d.ts +112 -0
  233. package/dist/lib/fluid-hover-highlight.js +17 -0
  234. package/dist/lib/focus-ring.d.ts +18 -0
  235. package/dist/lib/focus-ring.js +10 -0
  236. package/dist/lib/goo-indicator.d.ts +46 -0
  237. package/dist/lib/goo-indicator.js +14 -0
  238. package/dist/lib/icon-context.d.ts +30 -0
  239. package/dist/lib/icon-context.js +12 -0
  240. package/dist/lib/inert.d.ts +9 -0
  241. package/dist/lib/inert.js +8 -0
  242. package/dist/lib/morph-layers.d.ts +93 -0
  243. package/dist/lib/morph-layers.js +13 -0
  244. package/dist/lib/morph-part.d.ts +21 -0
  245. package/dist/lib/morph-part.js +12 -0
  246. package/dist/lib/popup.d.ts +20 -0
  247. package/dist/lib/popup.js +12 -0
  248. package/dist/lib/reduced-motion.d.ts +9 -0
  249. package/dist/lib/reduced-motion.js +6 -0
  250. package/dist/lib/row-index.d.ts +10 -0
  251. package/dist/lib/row-index.js +8 -0
  252. package/dist/lib/row-order.d.ts +28 -0
  253. package/dist/lib/row-order.js +10 -0
  254. package/dist/lib/scroll-column.d.ts +27 -0
  255. package/dist/lib/scroll-column.js +18 -0
  256. package/dist/lib/shape-context.d.ts +30 -0
  257. package/dist/lib/shape-context.js +12 -0
  258. package/dist/lib/size-context.d.ts +94 -0
  259. package/dist/lib/size-context.js +20 -0
  260. package/dist/lib/size-scale.d.ts +79 -0
  261. package/dist/lib/size-scale.js +8 -0
  262. package/dist/lib/slot.d.ts +12 -0
  263. package/dist/lib/slot.js +6 -0
  264. package/dist/lib/springs.d.ts +44 -0
  265. package/dist/lib/springs.js +8 -0
  266. package/dist/lib/surface-classes.d.ts +19 -0
  267. package/dist/lib/surface-classes.js +10 -0
  268. package/dist/lib/surface-context.d.ts +9 -0
  269. package/dist/lib/surface-context.js +8 -0
  270. package/dist/lib/use-controllable-state.d.ts +2 -0
  271. package/dist/lib/use-controllable-state.js +6 -0
  272. package/dist/lib/use-fluid-hover.d.ts +138 -0
  273. package/dist/lib/use-fluid-hover.js +14 -0
  274. package/dist/lib/use-is-mobile.d.ts +2 -0
  275. package/dist/lib/use-is-mobile.js +6 -0
  276. package/dist/lib/use-keyboard-nav-gate.d.ts +20 -0
  277. package/dist/lib/use-keyboard-nav-gate.js +7 -0
  278. package/dist/lib/use-merge-split.d.ts +47 -0
  279. package/dist/lib/use-merge-split.js +15 -0
  280. package/dist/lib/use-morph.d.ts +101 -0
  281. package/dist/lib/use-morph.js +20 -0
  282. package/dist/lib/use-touch-primary.d.ts +2 -0
  283. package/dist/lib/use-touch-primary.js +6 -0
  284. package/dist/lib/utils.d.ts +3 -0
  285. package/dist/lib/utils.js +6 -0
  286. package/dist/preset.d.ts +17 -0
  287. package/dist/preset.js +22 -2
  288. package/dist/primitives/code/index.js +7 -5
  289. package/dist/primitives/craft/index.js +9 -6
  290. package/dist/primitives/fluid-hover/index.js +9 -8
  291. package/dist/primitives/morph/index.js +15 -10
  292. package/dist/primitives/motion/index.js +10 -8
  293. package/dist/primitives/scroll-area/index.js +4 -3
  294. package/dist/primitives/separator/index.d.ts +25 -0
  295. package/dist/primitives/separator/index.js +9 -0
  296. package/dist/primitives/sizes/index.js +6 -4
  297. package/dist/primitives/skeleton/index.d.ts +35 -0
  298. package/dist/primitives/skeleton/index.js +12 -0
  299. package/dist/primitives/surface/index.js +6 -4
  300. package/dist/shared/{components-3mkepka5.js → components-0jmqhx2k.js} +28 -25
  301. package/dist/shared/components-124epb7f.js +53 -0
  302. package/dist/shared/{components-gz8zf3ec.js → components-1k0wv53d.js} +15 -43
  303. package/dist/shared/components-26snnbs9.js +322 -0
  304. package/dist/shared/{components-2dxkv6zm.js → components-2c0qcfx4.js} +8 -7
  305. package/dist/shared/{components-473g814w.js → components-2mt9te6d.js} +243 -137
  306. package/dist/shared/{components-hawvy2qz.js → components-2z48g4fp.js} +9 -30
  307. package/dist/shared/components-34txk9rj.js +35 -0
  308. package/dist/shared/components-3h92d94m.js +23 -0
  309. package/dist/shared/{components-zfnmn5d4.js → components-3sp623ae.js} +36 -31
  310. package/dist/shared/{components-jwst3vtj.js → components-3wxkjgqn.js} +186 -76
  311. package/dist/shared/{components-s2bz1xpk.js → components-49bsynbw.js} +8 -5
  312. package/dist/shared/components-4bwsd46w.js +71 -0
  313. package/dist/shared/components-4n4f5m3e.js +297 -0
  314. package/dist/shared/{components-0q0sqfh4.js → components-4y816hwp.js} +27 -49
  315. package/dist/shared/components-52ngsgca.js +399 -0
  316. package/dist/shared/{components-y9y0g8er.js → components-52r5763g.js} +22 -19
  317. package/dist/shared/components-559tf7yb.js +28 -0
  318. package/dist/shared/components-5mkga9hj.js +440 -0
  319. package/dist/shared/{components-kwa6mrf9.js → components-5s0nfqvw.js} +14 -9
  320. package/dist/shared/{components-dk0gjr5a.js → components-60atskhp.js} +19 -18
  321. package/dist/shared/{components-rr7a6ja9.js → components-658b26nb.js} +21 -18
  322. package/dist/shared/{components-xxvdw7k1.js → components-65vwfjs6.js} +37 -34
  323. package/dist/shared/{components-frw34b65.js → components-6j2fh74k.js} +114 -123
  324. package/dist/shared/components-6zg1yft7.js +167 -0
  325. package/dist/shared/components-6zng858q.js +53 -0
  326. package/dist/shared/components-72w4ge68.js +64 -0
  327. package/dist/shared/{components-cv16mryv.js → components-78x40gee.js} +13 -7
  328. package/dist/shared/{components-b2wyq2cq.js → components-7d4r7hh1.js} +39 -57
  329. package/dist/shared/components-7ntvvegr.js +316 -0
  330. package/dist/shared/components-8nwsqjn8.js +34 -0
  331. package/dist/shared/{components-5xc2j8jz.js → components-8tt3xbb5.js} +19 -18
  332. package/dist/shared/{components-vc7vq5nz.js → components-9as3rf68.js} +6 -3
  333. package/dist/shared/components-9mys9jna.js +255 -0
  334. package/dist/shared/components-adkarj8n.js +35 -0
  335. package/dist/shared/{components-b3c5et5b.js → components-ae9fncz4.js} +32 -31
  336. package/dist/shared/{components-hqeq3w9q.js → components-awra5sff.js} +24 -16
  337. package/dist/shared/components-b1e239g3.js +28 -0
  338. package/dist/shared/{components-q5xj5c16.js → components-b1f2bjf1.js} +9 -8
  339. package/dist/shared/{components-qmmjx1qw.js → components-bn42vq6d.js} +71 -72
  340. package/dist/shared/components-c96g82th.js +1444 -0
  341. package/dist/shared/components-c9yr4ed1.js +44 -0
  342. package/dist/shared/components-d3shbwqq.js +95 -0
  343. package/dist/shared/{components-jjw69c4c.js → components-dcc02hs2.js} +7 -4
  344. package/dist/shared/{components-men63rwj.js → components-de99ykt7.js} +3 -2
  345. package/dist/shared/components-dhgk6mbt.js +16 -0
  346. package/dist/shared/components-drxrtnp2.js +25 -0
  347. package/dist/shared/{components-6p8tfcd6.js → components-ds9fqat9.js} +21 -18
  348. package/dist/shared/{components-mjthm1kf.js → components-egy4tyjt.js} +11 -8
  349. package/dist/shared/components-f0xfpkhh.js +82 -0
  350. package/dist/shared/components-f7h57m6t.js +59 -0
  351. package/dist/shared/{components-d6xtjht3.js → components-fjkpbg6n.js} +33 -30
  352. package/dist/shared/{components-gc5vtq2f.js → components-gh0qeey3.js} +63 -29
  353. package/dist/shared/{components-39jq9va1.js → components-gvbapfen.js} +29 -24
  354. package/dist/shared/{components-5vgpnxgy.js → components-gzesg7hy.js} +19 -16
  355. package/dist/shared/components-h6p86be3.js +19 -0
  356. package/dist/shared/components-h83az0bz.js +33 -0
  357. package/dist/shared/components-jjrj6ymn.js +104 -0
  358. package/dist/shared/{components-wvp1m52g.js → components-jp5v0m0f.js} +15 -14
  359. package/dist/shared/{components-zrkzcayz.js → components-jqpefjsn.js} +54 -6
  360. package/dist/shared/{components-1z6tdadk.js → components-k74j4hwh.js} +20 -17
  361. package/dist/shared/components-kswxnm3h.js +24 -0
  362. package/dist/shared/{components-jbbmdr74.js → components-mkkbbgb7.js} +36 -17
  363. package/dist/shared/{components-pbmqctfa.js → components-mpw667rb.js} +169 -65
  364. package/dist/shared/{components-s5ngg32c.js → components-paa08427.js} +121 -47
  365. package/dist/shared/{components-vfbhxf5r.js → components-pd42emw3.js} +6 -5
  366. package/dist/shared/{components-hw9yk32z.js → components-pmfszv7a.js} +35 -23
  367. package/dist/shared/{components-chacnk61.js → components-pw06rbxq.js} +19 -19
  368. package/dist/shared/components-q03cktx8.js +246 -0
  369. package/dist/shared/{components-kvr7f9hy.js → components-qdm3yh26.js} +19 -10
  370. package/dist/shared/{components-27nnvrwe.js → components-qs4rkqsj.js} +15 -14
  371. package/dist/shared/{components-s083f38z.js → components-r6gbmkew.js} +22 -21
  372. package/dist/shared/{components-ta7shw28.js → components-r8eqs7gz.js} +4 -4
  373. package/dist/shared/{components-sn1rxx1d.js → components-rm02h9nt.js} +12 -11
  374. package/dist/shared/{components-c6s6b43g.js → components-rrbpmfx4.js} +3 -2
  375. package/dist/shared/{components-n7mjr357.js → components-tz1fv35x.js} +3 -2
  376. package/dist/shared/components-tz4gaf1v.js +23 -0
  377. package/dist/shared/{components-zx6b6yby.js → components-vf45j12c.js} +4 -18
  378. package/dist/shared/{components-3ky44908.js → components-vfjc9jzz.js} +2 -3
  379. package/dist/shared/{components-39vmfq9s.js → components-vsa625vk.js} +21 -20
  380. package/dist/shared/components-wawnmkph.js +500 -0
  381. package/dist/shared/components-wktrrb4m.js +38 -0
  382. package/dist/shared/{components-8snj490h.js → components-wwd363me.js} +78 -32
  383. package/dist/shared/{components-5pnw8183.js → components-xcwvgcrd.js} +23 -22
  384. package/dist/shared/components-xdqmt6ed.js +20 -0
  385. package/dist/shared/{components-h2ajmhwn.js → components-y1w3a6wx.js} +107 -35
  386. package/dist/shared/{components-ar66gnt0.js → components-y6578b8h.js} +37 -34
  387. package/dist/shared/{components-59efxjd9.js → components-yhgq0qxx.js} +13 -12
  388. package/dist/shared/{components-jthe1pwb.js → components-yz84gpkq.js} +101 -404
  389. package/dist/shared/components-z3v0n0de.js +11 -0
  390. package/dist/shared/{components-7r3etddy.js → components-z9n19fyk.js} +19 -54
  391. package/dist/shared/components-zbvjzh1p.js +141 -0
  392. package/dist/styles.css +241 -16
  393. package/dist/tailwind.css +13 -0
  394. package/dist/tokens.css +34 -0
  395. package/index.ts +60 -0
  396. package/lib/date-locale.ts +50 -0
  397. package/lib/field-classes.ts +115 -0
  398. package/lib/field-variants.ts +117 -0
  399. package/lib/fluid-hover-highlight.tsx +139 -0
  400. package/lib/focus-ring.tsx +46 -0
  401. package/lib/goo-indicator.tsx +261 -0
  402. package/lib/icon-context.tsx +310 -0
  403. package/lib/inert.ts +22 -0
  404. package/lib/morph-layers.tsx +102 -0
  405. package/lib/morph-part.tsx +49 -0
  406. package/lib/popup.ts +52 -0
  407. package/lib/reduced-motion.ts +19 -0
  408. package/lib/row-index.tsx +29 -0
  409. package/lib/row-order.tsx +115 -0
  410. package/lib/scroll-column.tsx +244 -0
  411. package/lib/shape-context.tsx +124 -0
  412. package/lib/size-context.tsx +66 -0
  413. package/lib/size-scale.ts +115 -0
  414. package/lib/slot.ts +25 -0
  415. package/lib/springs.ts +62 -0
  416. package/lib/surface-classes.ts +58 -0
  417. package/lib/surface-context.tsx +21 -0
  418. package/lib/use-controllable-state.ts +44 -0
  419. package/lib/use-fluid-hover.ts +541 -0
  420. package/lib/use-is-mobile.ts +25 -0
  421. package/lib/use-keyboard-nav-gate.ts +45 -0
  422. package/lib/use-merge-split.tsx +209 -0
  423. package/lib/use-morph.ts +557 -0
  424. package/lib/use-touch-primary.tsx +43 -0
  425. package/lib/utils.ts +37 -0
  426. package/package.json +177 -4
  427. package/preset.ts +196 -0
  428. package/primitives/code/examples.mdx +27 -0
  429. package/primitives/code/index.tsx +80 -0
  430. package/primitives/craft/demos.tsx +173 -0
  431. package/primitives/craft/examples.mdx +138 -0
  432. package/primitives/craft/index.tsx +76 -0
  433. package/primitives/fluid-hover/examples.mdx +84 -0
  434. package/primitives/fluid-hover/index.tsx +316 -0
  435. package/primitives/morph/examples.mdx +135 -0
  436. package/primitives/morph/index.tsx +192 -0
  437. package/primitives/motion/examples.mdx +100 -0
  438. package/primitives/motion/index.tsx +160 -0
  439. package/primitives/scroll-area/examples.mdx +58 -0
  440. package/primitives/scroll-area/index.tsx +200 -0
  441. package/primitives/separator/examples.mdx +30 -0
  442. package/primitives/separator/index.tsx +53 -0
  443. package/primitives/sizes/examples.mdx +167 -0
  444. package/primitives/sizes/index.tsx +89 -0
  445. package/primitives/skeleton/examples.mdx +51 -0
  446. package/primitives/skeleton/index.tsx +72 -0
  447. package/primitives/skeleton/skeleton.css +15 -0
  448. package/primitives/surface/examples.mdx +173 -0
  449. package/primitives/surface/index.tsx +109 -0
  450. package/primitives/surface/surface.css +176 -0
  451. package/dist/shared/components-0sn7ypjw.js +0 -61
  452. package/dist/shared/components-1434p1mh.js +0 -123
  453. package/dist/shared/components-a86dytt0.js +0 -986
  454. package/dist/shared/components-gf5s6ap9.js +0 -42
  455. package/dist/shared/components-hyq23phv.js +0 -310
  456. package/dist/shared/components-ng72k97e.js +0 -128
  457. package/dist/shared/components-raknhppb.js +0 -64
  458. package/dist/shared/components-vynjtrk6.js +0 -19
  459. package/dist/shared/components-wy9jpqny.js +0 -146
  460. /package/dist/shared/{components-1v7rxytx.js → components-3ey0hzpb.js} +0 -0
  461. /package/dist/shared/{components-ezxhrmer.js → components-jcnjay5g.js} +0 -0
@@ -0,0 +1,35 @@
1
+ // lib/size-scale.ts
2
+ var sizeMap2 = {
3
+ default: {
4
+ variant: "default",
5
+ control: "h-9",
6
+ controlHeight: 36,
7
+ segmentItem: "h-7",
8
+ segmentPad: "p-1",
9
+ text: "text-body",
10
+ px: "px-3",
11
+ itemPx: "px-2",
12
+ gap: "gap-2",
13
+ icon: 16
14
+ },
15
+ compact: {
16
+ variant: "compact",
17
+ control: "h-7",
18
+ controlHeight: 28,
19
+ segmentItem: "h-6",
20
+ segmentPad: "p-0.5",
21
+ text: "text-body-compact",
22
+ px: "px-2.5",
23
+ itemPx: "px-1.5",
24
+ gap: "gap-1",
25
+ icon: 14
26
+ }
27
+ };
28
+ var typeScale2 = {
29
+ display: { default: 28, compact: 24 },
30
+ title: { default: 16, compact: 15 },
31
+ subtitle: { default: 14, compact: 13 },
32
+ body: { default: 13, compact: 12 },
33
+ caption: { default: 12, compact: 11 }
34
+ };
35
+ export { sizeMap2, typeScale2 };
@@ -0,0 +1,23 @@
1
+ "use client";
2
+ import {
3
+ cn2
4
+ } from "./components-jcnjay5g.js";
5
+
6
+ // primitives/separator/index.tsx
7
+ import { Separator as SeparatorPrimitive } from "@base-ui/react/separator";
8
+ import { forwardRef } from "react";
9
+ import { jsx } from "react/jsx-runtime";
10
+ var ORIENTATION = {
11
+ horizontal: "h-px w-full",
12
+ vertical: "w-px self-stretch"
13
+ };
14
+ var Separator2 = forwardRef(({ orientation = "horizontal", className, ...props }, ref) => /* @__PURE__ */ jsx(SeparatorPrimitive, {
15
+ ref,
16
+ ...props,
17
+ orientation,
18
+ className: cn2("shrink-0 bg-border", ORIENTATION[orientation], className)
19
+ }));
20
+ Separator2.displayName = "Separator";
21
+ var separator_default = Separator2;
22
+
23
+ export { Separator2, separator_default };
@@ -1,39 +1,44 @@
1
+ "use client";
1
2
  import {
2
- useIcon
3
- } from "./components-zrkzcayz.js";
3
+ useIcon2
4
+ } from "./components-jqpefjsn.js";
4
5
  import {
5
- MorphPartScope,
6
- MorphSurface
7
- } from "./components-0q0sqfh4.js";
6
+ MorphPartScope2
7
+ } from "./components-b1e239g3.js";
8
8
  import {
9
- useMorphOrigin,
10
- useMorph
11
- } from "./components-hqeq3w9q.js";
9
+ useMorphOrigin2,
10
+ useMorph2
11
+ } from "./components-awra5sff.js";
12
12
  import {
13
13
  cn2
14
- } from "./components-ezxhrmer.js";
14
+ } from "./components-jcnjay5g.js";
15
15
  import {
16
- useShape
17
- } from "./components-cv16mryv.js";
16
+ MorphSurface2
17
+ } from "./components-4y816hwp.js";
18
+ import {
19
+ useShape2
20
+ } from "./components-78x40gee.js";
18
21
  import {
19
22
  useSizeVariant2,
20
23
  useSize2
21
- } from "./components-0sn7ypjw.js";
24
+ } from "./components-h83az0bz.js";
25
+ import {
26
+ slotRender2
27
+ } from "./components-vfjc9jzz.js";
22
28
  import {
23
- slotRender
24
- } from "./components-3ky44908.js";
29
+ SURFACE_BG2,
30
+ SURFACE_SHADOW2
31
+ } from "./components-vf45j12c.js";
25
32
  import {
26
- SURFACE_BG,
27
- SURFACE_SHADOW,
28
33
  useSurface2,
29
34
  SurfaceProvider2
30
- } from "./components-zx6b6yby.js";
35
+ } from "./components-dhgk6mbt.js";
31
36
  import {
32
- useControllableState
33
- } from "./components-n7mjr357.js";
37
+ useControllableState2
38
+ } from "./components-tz1fv35x.js";
34
39
  import {
35
40
  Button2
36
- } from "./components-b2wyq2cq.js";
41
+ } from "./components-7d4r7hh1.js";
37
42
 
38
43
  // components/overlays/dialog/index.tsx
39
44
  import { Dialog as DialogPrimitive } from "@base-ui/react/dialog";
@@ -54,7 +59,7 @@ var DialogContext = createContext({
54
59
  });
55
60
  var useDialogState2 = () => useContext(DialogContext);
56
61
  var DialogTrigger2 = forwardRef(({ render, asChild, children, ...props }, ref) => {
57
- const el = slotRender(render, asChild, children);
62
+ const el = slotRender2(render, asChild, children);
58
63
  return el ? /* @__PURE__ */ jsx(DialogPrimitive.Trigger, {
59
64
  ref,
60
65
  render: el,
@@ -67,7 +72,7 @@ var DialogTrigger2 = forwardRef(({ render, asChild, children, ...props }, ref) =
67
72
  });
68
73
  DialogTrigger2.displayName = "DialogTrigger";
69
74
  var DialogClose2 = forwardRef(({ render, asChild, children, ...props }, ref) => {
70
- const el = slotRender(render, asChild, children);
75
+ const el = slotRender2(render, asChild, children);
71
76
  return el ? /* @__PURE__ */ jsx(DialogPrimitive.Close, {
72
77
  ref,
73
78
  render: el,
@@ -92,13 +97,13 @@ var DialogContent2 = forwardRef(({
92
97
  tier,
93
98
  ...props
94
99
  }, ref) => {
95
- const XIcon = useIcon("x");
96
- const shape = useShape();
100
+ const XIcon = useIcon2("x");
101
+ const shape = useShape2();
97
102
  const substrate = useSurface2();
98
103
  const dialogLevel = Math.min(substrate + DIALOG_OFFSET, 8);
99
104
  const compact = useSize2().variant === "compact";
100
105
  const { open, origin } = useDialogState2();
101
- const morph = useMorph(open, origin, { from, effect, hideSource, tier });
106
+ const morph = useMorph2(open, origin, { from, effect, hideSource, tier });
102
107
  useImperativeHandle(ref, () => morph.popup, [morph.popup]);
103
108
  return /* @__PURE__ */ jsxs(DialogPrimitive.Portal, {
104
109
  container: container ?? undefined,
@@ -115,10 +120,10 @@ var DialogContent2 = forwardRef(({
115
120
  className: cn2(container ? "absolute" : "fixed", "left-1/2 z-50 w-[calc(100%-2rem)] -translate-x-1/2 focus:outline-none", position === "top" ? "top-[12dvh]" : "top-1/2 -translate-y-1/2", size === "sm" && (compact ? "max-w-[360px]" : "max-w-[400px]"), size === "lg" && (compact ? "max-w-[480px]" : "max-w-[540px]"), size === "xl" && (compact ? "max-w-[800px]" : "max-w-[880px]")),
116
121
  children: /* @__PURE__ */ jsx(SurfaceProvider2, {
117
122
  value: dialogLevel,
118
- children: /* @__PURE__ */ jsxs(MorphSurface, {
123
+ children: /* @__PURE__ */ jsxs(MorphSurface2, {
119
124
  morph,
120
- bg: SURFACE_BG[dialogLevel],
121
- shadow: SURFACE_SHADOW[dialogLevel],
125
+ bg: SURFACE_BG2[dialogLevel],
126
+ shadow: SURFACE_SHADOW2[dialogLevel],
122
127
  radius: shape.container,
123
128
  className: cn2("p-6", className),
124
129
  children: [
@@ -176,14 +181,14 @@ var DialogDescription2 = forwardRef(({ className, ...props }, ref) => {
176
181
  });
177
182
  DialogDescription2.displayName = "DialogDescription";
178
183
  function DialogState2({ open, defaultOpen = false, onOpenChange, children }) {
179
- const [current, setCurrent] = useControllableState(open, defaultOpen, onOpenChange);
180
- const { origin, capture } = useMorphOrigin();
184
+ const [current, setCurrent] = useControllableState2(open, defaultOpen, onOpenChange);
185
+ const { origin, capture } = useMorphOrigin2();
181
186
  const id = useId();
182
187
  const ctx = useMemo(() => ({ open: current, origin }), [current, origin]);
183
188
  const parts = useMemo(() => ({ id, open: current }), [id, current]);
184
189
  return /* @__PURE__ */ jsx(DialogContext.Provider, {
185
190
  value: ctx,
186
- children: /* @__PURE__ */ jsx(MorphPartScope.Provider, {
191
+ children: /* @__PURE__ */ jsx(MorphPartScope2.Provider, {
187
192
  value: parts,
188
193
  children: children({
189
194
  open: current,
@@ -1,46 +1,52 @@
1
+ "use client";
1
2
  import {
2
- useReduceMotion
3
- } from "./components-men63rwj.js";
3
+ useIcons2
4
+ } from "./components-jqpefjsn.js";
4
5
  import {
5
- GooFilter
6
- } from "./components-0q0sqfh4.js";
6
+ useReduceMotion2
7
+ } from "./components-de99ykt7.js";
7
8
  import {
8
- GOO_BLUR_RATIO,
9
- holdExit
10
- } from "./components-hqeq3w9q.js";
9
+ spring2
10
+ } from "./components-3ey0hzpb.js";
11
+ import {
12
+ GOO_BLUR_RATIO2,
13
+ holdExit2
14
+ } from "./components-awra5sff.js";
11
15
  import {
12
16
  cn2
13
- } from "./components-ezxhrmer.js";
17
+ } from "./components-jcnjay5g.js";
14
18
  import {
15
- useShape
16
- } from "./components-cv16mryv.js";
19
+ GooFilter2
20
+ } from "./components-4y816hwp.js";
21
+ import {
22
+ useShape2
23
+ } from "./components-78x40gee.js";
17
24
  import {
18
25
  sizeMap2
19
- } from "./components-0sn7ypjw.js";
26
+ } from "./components-34txk9rj.js";
27
+ import {
28
+ slotRender2
29
+ } from "./components-vfjc9jzz.js";
20
30
  import {
21
- slotRender
22
- } from "./components-3ky44908.js";
31
+ SURFACE_BG2,
32
+ SURFACE_SHADOW2
33
+ } from "./components-vf45j12c.js";
23
34
  import {
24
- SURFACE_BG,
25
- SURFACE_SHADOW,
26
35
  useSurface2,
27
36
  SurfaceProvider2
28
- } from "./components-zx6b6yby.js";
37
+ } from "./components-dhgk6mbt.js";
29
38
  import {
30
39
  button_default
31
- } from "./components-b2wyq2cq.js";
32
- import {
33
- spring2
34
- } from "./components-1v7rxytx.js";
40
+ } from "./components-7d4r7hh1.js";
35
41
 
36
42
  // components/overlays/toast/index.tsx
37
- import { Toast as ToastPrimitive } from "@base-ui/react/toast";
38
- import { ArrowRight, Check, CircleAlert, Info, LoaderCircle, X } from "lucide-react";
43
+ import { Toast as ToastPrimitive2 } from "@base-ui/react/toast";
39
44
  import { AnimatePresence, motion } from "motion/react";
40
45
  import {
41
46
  cloneElement,
42
47
  createContext,
43
48
  forwardRef,
49
+ isValidElement as isValidElement2,
44
50
  useContext,
45
51
  useEffect,
46
52
  useId,
@@ -49,14 +55,102 @@ import {
49
55
  useRef,
50
56
  useState
51
57
  } from "react";
52
- import { jsx, jsxs } from "react/jsx-runtime";
58
+
59
+ // components/overlays/toast/manager.ts
60
+ import { Toast as ToastPrimitive } from "@base-ui/react/toast";
61
+ import { isValidElement } from "react";
62
+ var isActionButton = (action) => typeof action === "object" && action !== null && !isValidElement(action) && ("label" in action);
63
+ function defined(value) {
64
+ return Object.fromEntries(Object.entries(value).filter(([, v]) => v !== undefined));
65
+ }
66
+ function toManagerOptions(input) {
67
+ const { action, icon, duration, timeout, ...rest } = typeof input === "string" ? { title: input } : input;
68
+ const button = isActionButton(action);
69
+ return defined({
70
+ ...rest,
71
+ timeout: timeout ?? duration,
72
+ actionProps: button ? { children: action.label, onClick: action.onClick } : undefined,
73
+ data: icon !== undefined || action !== undefined && !button ? { icon, action: button ? undefined : action } : undefined
74
+ });
75
+ }
76
+ var withType = (input, type) => typeof input === "string" ? { title: input, type } : { ...input, type };
77
+ var resultOptions = (result) => typeof result === "function" ? (value) => toManagerOptions(result(value)) : toManagerOptions(result);
78
+ function createQueuedManager() {
79
+ const manager = ToastPrimitive.createToastManager();
80
+ let listeners = 0;
81
+ let queue = [];
82
+ let count = 0;
83
+ const browser = () => typeof window !== "undefined";
84
+ const whenHeard = (run) => {
85
+ if (listeners)
86
+ run();
87
+ else if (browser())
88
+ queue.push(run);
89
+ };
90
+ return {
91
+ " subscribe": (listener) => {
92
+ const unsubscribe = manager[" subscribe"](listener);
93
+ listeners++;
94
+ const queued = queue;
95
+ queue = [];
96
+ for (const run of queued)
97
+ run();
98
+ return () => {
99
+ listeners--;
100
+ unsubscribe();
101
+ };
102
+ },
103
+ add: (options) => {
104
+ const id = options.id ?? `toast-global-${++count}`;
105
+ whenHeard(() => manager.add({ ...options, id }));
106
+ return id;
107
+ },
108
+ close: (id) => whenHeard(() => manager.close(id)),
109
+ update: (id, updates) => whenHeard(() => manager.update(id, updates)),
110
+ promise: (promise, options) => {
111
+ if (listeners)
112
+ return manager.promise(promise, options);
113
+ if (browser())
114
+ queue.push(() => manager.promise(promise, options).catch(() => {}));
115
+ return promise;
116
+ }
117
+ };
118
+ }
119
+ var manager = createQueuedManager();
120
+ function show(input, type) {
121
+ const options = toManagerOptions(input);
122
+ const id = manager.add({ type: "info", ...options, ...type && { type } });
123
+ return {
124
+ id,
125
+ update: (next) => manager.update(id, toManagerOptions(next)),
126
+ dismiss: () => manager.close(id)
127
+ };
128
+ }
129
+ var toast2 = Object.assign((input) => show(input), {
130
+ success: (input) => show(input, "success"),
131
+ error: (input) => show(input, "error"),
132
+ warning: (input) => show(input, "warning"),
133
+ info: (input) => show(input, "info"),
134
+ loading: (input) => show(withType(input, "loading")),
135
+ promise: (promise, options) => manager.promise(promise, {
136
+ loading: toManagerOptions(options.loading),
137
+ success: resultOptions(options.success),
138
+ error: resultOptions(options.error)
139
+ }),
140
+ update: (id, input) => manager.update(id, toManagerOptions(input)),
141
+ dismiss: (id) => manager.close(id),
142
+ " subscribe": manager[" subscribe"]
143
+ });
144
+
145
+ // components/overlays/toast/index.tsx
146
+ import { jsx, jsxs, Fragment } from "react/jsx-runtime";
53
147
  var ICONS = {
54
- success: Check,
55
- loading: LoaderCircle,
56
- error: X,
57
- warning: CircleAlert,
58
- info: Info,
59
- action: ArrowRight
148
+ success: "check",
149
+ loading: "loader-circle",
150
+ error: "x",
151
+ warning: "circle-alert",
152
+ info: "info",
153
+ action: "arrow-right"
60
154
  };
61
155
  var TONES = {
62
156
  success: "text-status-success bg-status-success/16",
@@ -75,7 +169,7 @@ var VIEWPORT = {
75
169
  "bottom-right": "bottom-4 right-4 flex-col-reverse items-end"
76
170
  };
77
171
  var PILL = sizeMap2.default.controlHeight;
78
- var BLUR = PILL / 2 * GOO_BLUR_RATIO;
172
+ var BLUR = PILL / 2 * GOO_BLUR_RATIO2;
79
173
  var SNAP = { duration: 0 };
80
174
  var AUTO_EXPAND_MS = 150;
81
175
  var AUTO_COLLAPSE_BEFORE_MS = 2000;
@@ -84,31 +178,31 @@ var ToastSettings = createContext({
84
178
  timeout: 6000
85
179
  });
86
180
  function useToast2() {
87
- const manager = ToastPrimitive.useToastManager();
181
+ const manager = ToastPrimitive2.useToastManager();
88
182
  return useMemo(() => {
89
- const options = ({ action, ...rest }, type) => ({
90
- ...rest,
91
- type,
92
- actionProps: action && { children: action.label, onClick: action.onClick }
93
- });
94
- const show = (o) => manager.add(options(o, o.type ?? "info"));
183
+ const show = (o) => manager.add({ type: "info", ...toManagerOptions(o) });
184
+ const typed = (type) => (o) => show(typeof o === "string" ? { title: o, type } : { ...o, type });
185
+ const result = (r) => typeof r === "function" ? (value) => toManagerOptions(r(value)) : toManagerOptions(r);
95
186
  return {
187
+ toasts: manager.toasts,
96
188
  show,
97
- success: (o) => show({ ...o, type: "success" }),
98
- error: (o) => show({ ...o, type: "error" }),
99
- warning: (o) => show({ ...o, type: "warning" }),
100
- info: (o) => show({ ...o, type: "info" }),
189
+ success: typed("success"),
190
+ error: typed("error"),
191
+ warning: typed("warning"),
192
+ info: typed("info"),
101
193
  promise: (promise, o) => manager.promise(promise, {
102
- loading: options(o.loading, "loading"),
103
- success: options(o.success, "success"),
104
- error: options(o.error, "error")
194
+ loading: toManagerOptions(o.loading),
195
+ success: result(o.success),
196
+ error: result(o.error)
105
197
  }),
106
- close: manager.close
198
+ update: (id, o) => manager.update(id, toManagerOptions(o)),
199
+ close: manager.close,
200
+ dismiss: manager.close
107
201
  };
108
202
  }, [manager]);
109
203
  }
110
204
  function Shape({ box, className, shapeRef }) {
111
- const reduced = useReduceMotion();
205
+ const reduced = useReduceMotion2();
112
206
  return /* @__PURE__ */ jsx(motion.div, {
113
207
  ref: shapeRef,
114
208
  "aria-hidden": true,
@@ -118,16 +212,30 @@ function Shape({ box, className, shapeRef }) {
118
212
  transition: reduced ? SNAP : spring2.slow
119
213
  });
120
214
  }
215
+ function StatusIcon({ type, icon }) {
216
+ const icons = useIcons2();
217
+ const component = typeof icon === "function" || typeof icon === "object" && icon !== null && "$$typeof" in icon && !isValidElement2(icon);
218
+ if (icon != null && icon !== false && !component)
219
+ return /* @__PURE__ */ jsx(Fragment, {
220
+ children: icon
221
+ });
222
+ const Icon = component ? icon : icons[ICONS[type]];
223
+ return /* @__PURE__ */ jsx(Icon, {
224
+ size: 14,
225
+ strokeWidth: 2.5,
226
+ className: type === "loading" && !component ? "animate-spin" : undefined
227
+ });
228
+ }
121
229
  function ToastItem({ toast }) {
122
230
  const { position, timeout } = useContext(ToastSettings);
123
- const shape = useShape();
231
+ const shape = useShape2();
124
232
  const level = Math.min(useSurface2() + 2, 8);
125
233
  const gooId = `toast-goo-${useId().replace(/:/g, "")}`;
126
234
  const type = toast.type ?? "info";
127
- const Icon = ICONS[type];
235
+ const customAction = toast.data?.action;
128
236
  const top = position.startsWith("top");
129
237
  const ending = toast.transitionStatus === "ending";
130
- const hasBody = Boolean(toast.description || toast.actionProps);
238
+ const hasBody = Boolean(toast.description || toast.actionProps || customAction);
131
239
  const [hovered, setHovered] = useState(false);
132
240
  const [auto, setAuto] = useState(false);
133
241
  const expanded = hasBody && type !== "loading" && !ending && (hovered || auto);
@@ -164,7 +272,7 @@ function ToastItem({ toast }) {
164
272
  useLayoutEffect(() => {
165
273
  if (!ending || !root.current)
166
274
  return;
167
- const hold = holdExit(root.current, "moderate");
275
+ const hold = holdExit2(root.current, "moderate");
168
276
  return () => hold.cancel();
169
277
  }, [ending]);
170
278
  const bodyHeight = expanded ? size.body : 0;
@@ -173,10 +281,10 @@ function ToastItem({ toast }) {
173
281
  const pillHeight = PILL + Math.min(bodyHeight, size.radius);
174
282
  const pill = { x: pillX, y: top ? 0 : height - pillHeight, width: size.pill, height: pillHeight };
175
283
  const bodyBox = { x: 0, y: top ? PILL : 0, width: size.width, height: bodyHeight };
176
- const reduced = useReduceMotion();
284
+ const reduced = useReduceMotion2();
177
285
  const away = reduced ? { opacity: 0 } : { opacity: 0, y: top ? -6 : 6, scale: 0.95 };
178
286
  const move = reduced ? SNAP : spring2.slow;
179
- return /* @__PURE__ */ jsxs(ToastPrimitive.Root, {
287
+ return /* @__PURE__ */ jsxs(ToastPrimitive2.Root, {
180
288
  ref: root,
181
289
  toast,
182
290
  swipeDirection: [top ? "up" : "down", position.endsWith("left") ? "left" : "right"],
@@ -189,17 +297,17 @@ function ToastItem({ toast }) {
189
297
  }),
190
298
  className: "relative w-[min(22rem,calc(100vw-2rem))] select-none outline-none [translate:var(--toast-swipe-movement-x)_var(--toast-swipe-movement-y)]",
191
299
  children: [
192
- /* @__PURE__ */ jsx(GooFilter, {
300
+ /* @__PURE__ */ jsx(GooFilter2, {
193
301
  id: gooId,
194
302
  blur: BLUR
195
303
  }),
196
304
  /* @__PURE__ */ jsx(Shape, {
197
305
  box: pill,
198
- className: cn2("rounded-full", SURFACE_SHADOW[3])
306
+ className: cn2("rounded-full", SURFACE_SHADOW2[3])
199
307
  }),
200
308
  hasBody && /* @__PURE__ */ jsx(Shape, {
201
309
  box: bodyBox,
202
- className: cn2(shape.container, SURFACE_SHADOW[3])
310
+ className: cn2(shape.container, SURFACE_SHADOW2[3])
203
311
  }),
204
312
  /* @__PURE__ */ jsxs("div", {
205
313
  "aria-hidden": true,
@@ -208,12 +316,12 @@ function ToastItem({ toast }) {
208
316
  children: [
209
317
  /* @__PURE__ */ jsx(Shape, {
210
318
  box: pill,
211
- className: cn2("rounded-full", SURFACE_BG[level])
319
+ className: cn2("rounded-full", SURFACE_BG2[level])
212
320
  }),
213
321
  hasBody && /* @__PURE__ */ jsx(Shape, {
214
322
  box: bodyBox,
215
323
  shapeRef: bodyShape,
216
- className: cn2(shape.container, SURFACE_BG[level])
324
+ className: cn2(shape.container, SURFACE_BG2[level])
217
325
  })
218
326
  ]
219
327
  }),
@@ -226,7 +334,7 @@ function ToastItem({ toast }) {
226
334
  initial: false,
227
335
  animate: { x: pillX, y: top ? 0 : height - PILL },
228
336
  transition: move,
229
- children: /* @__PURE__ */ jsx(ToastPrimitive.Title, {
337
+ children: /* @__PURE__ */ jsx(ToastPrimitive2.Title, {
230
338
  className: "relative inline-flex items-center whitespace-nowrap",
231
339
  children: /* @__PURE__ */ jsx(AnimatePresence, {
232
340
  mode: "popLayout",
@@ -240,10 +348,9 @@ function ToastItem({ toast }) {
240
348
  children: [
241
349
  /* @__PURE__ */ jsx("span", {
242
350
  className: cn2("flex size-6 items-center justify-center rounded-full", TONES[type]),
243
- children: /* @__PURE__ */ jsx(Icon, {
244
- size: 14,
245
- strokeWidth: 2.5,
246
- className: type === "loading" ? "animate-spin" : undefined
351
+ children: /* @__PURE__ */ jsx(StatusIcon, {
352
+ type,
353
+ icon: toast.data?.icon
247
354
  })
248
355
  }),
249
356
  /* @__PURE__ */ jsx("span", {
@@ -251,7 +358,7 @@ function ToastItem({ toast }) {
251
358
  children: toast.title
252
359
  })
253
360
  ]
254
- }, `${type}-${toast.title}`)
361
+ }, `${type}-${typeof toast.title === "string" ? toast.title : toast.updateKey}`)
255
362
  })
256
363
  })
257
364
  }),
@@ -264,15 +371,16 @@ function ToastItem({ toast }) {
264
371
  ref: body,
265
372
  className: cn2("flex flex-col items-start gap-3 p-4", top ? "pt-6" : "pb-6"),
266
373
  children: [
267
- /* @__PURE__ */ jsx(ToastPrimitive.Description, {
374
+ /* @__PURE__ */ jsx(ToastPrimitive2.Description, {
268
375
  className: "text-caption text-muted-foreground"
269
376
  }),
270
- toast.actionProps && /* @__PURE__ */ jsx(ToastPrimitive.Action, {
377
+ toast.actionProps && /* @__PURE__ */ jsx(ToastPrimitive2.Action, {
271
378
  render: /* @__PURE__ */ jsx(button_default, {
272
379
  size: "compact",
273
380
  variant: "secondary"
274
381
  })
275
- })
382
+ }),
383
+ customAction
276
384
  ]
277
385
  })
278
386
  })
@@ -282,7 +390,7 @@ function ToastItem({ toast }) {
282
390
  });
283
391
  }
284
392
  function ToastList() {
285
- const { toasts } = ToastPrimitive.useToastManager();
393
+ const { toasts } = ToastPrimitive2.useToastManager();
286
394
  return toasts.map((toast) => /* @__PURE__ */ jsx(ToastItem, {
287
395
  toast
288
396
  }, toast.id));
@@ -292,6 +400,7 @@ var ToastTrigger2 = forwardRef(({
292
400
  description,
293
401
  type,
294
402
  timeout,
403
+ icon,
295
404
  action,
296
405
  promise,
297
406
  success,
@@ -302,15 +411,15 @@ var ToastTrigger2 = forwardRef(({
302
411
  onClick,
303
412
  ...props
304
413
  }, ref) => {
305
- const toast = useToast2();
306
- const el = slotRender(render, asChild, children);
414
+ const toasts = useToast2();
415
+ const el = slotRender2(render, asChild, children);
307
416
  const press = (event) => {
308
417
  onClick?.(event);
309
418
  if (promise) {
310
- toast.promise(promise(), { loading: { title, description }, success: success ?? {}, error: error ?? {} }).catch(() => {});
419
+ toasts.promise(promise(), { loading: { title, description, icon }, success: success ?? {}, error: error ?? {} }).catch(() => {});
311
420
  return;
312
421
  }
313
- toast.show({ title, description, type, timeout, action });
422
+ toasts.show({ title, description, type, timeout, icon, action });
314
423
  };
315
424
  return el ? cloneElement(el, { ...props, ref, onClick: press }) : /* @__PURE__ */ jsx("button", {
316
425
  ref,
@@ -321,17 +430,18 @@ var ToastTrigger2 = forwardRef(({
321
430
  });
322
431
  });
323
432
  ToastTrigger2.displayName = "ToastTrigger";
324
- function Toast2({ position = "top-right", limit = 3, timeout = 6000, children }) {
433
+ function Toast2({ position = "top-right", limit = 3, timeout = 6000, manager, children }) {
325
434
  const settings = useMemo(() => ({ position, timeout }), [position, timeout]);
326
- return /* @__PURE__ */ jsx(ToastPrimitive.Provider, {
435
+ return /* @__PURE__ */ jsx(ToastPrimitive2.Provider, {
327
436
  limit,
328
437
  timeout,
438
+ toastManager: manager,
329
439
  children: /* @__PURE__ */ jsxs(ToastSettings.Provider, {
330
440
  value: settings,
331
441
  children: [
332
442
  children,
333
- /* @__PURE__ */ jsx(ToastPrimitive.Portal, {
334
- children: /* @__PURE__ */ jsx(ToastPrimitive.Viewport, {
443
+ /* @__PURE__ */ jsx(ToastPrimitive2.Portal, {
444
+ children: /* @__PURE__ */ jsx(ToastPrimitive2.Viewport, {
335
445
  className: cn2("fixed z-[60] flex flex-col gap-2 outline-none", VIEWPORT[position]),
336
446
  children: /* @__PURE__ */ jsx(ToastList, {})
337
447
  })
@@ -343,4 +453,4 @@ function Toast2({ position = "top-right", limit = 3, timeout = 6000, children })
343
453
  Toast2.Trigger = ToastTrigger2;
344
454
  var toast_default = Toast2;
345
455
 
346
- export { useToast2, ToastTrigger2, Toast2, toast_default };
456
+ export { toast2, useToast2, ToastTrigger2, Toast2, toast_default };
@@ -1,13 +1,16 @@
1
+ "use client";
2
+ import {
3
+ SURFACE_BG2
4
+ } from "./components-vf45j12c.js";
1
5
  import {
2
- SURFACE_BG,
3
6
  useSurface2
4
- } from "./components-zx6b6yby.js";
7
+ } from "./components-dhgk6mbt.js";
5
8
  import {
6
9
  cn2
7
- } from "./components-ezxhrmer.js";
10
+ } from "./components-jcnjay5g.js";
8
11
  import {
9
12
  scroll_area_default
10
- } from "./components-hawvy2qz.js";
13
+ } from "./components-2z48g4fp.js";
11
14
 
12
15
  // primitives/code/index.tsx
13
16
  import { Fragment } from "react";
@@ -51,7 +54,7 @@ function Code2({
51
54
  return /* @__PURE__ */ jsx(scroll_area_default, {
52
55
  orientation: "horizontal",
53
56
  viewportClassName: "scroll-fade-x",
54
- className: cn2("rounded-xl", SURFACE_BG[level], className),
57
+ className: cn2("rounded-xl", SURFACE_BG2[level], className),
55
58
  children: /* @__PURE__ */ jsx("pre", {
56
59
  className: "m-0 w-max min-w-full p-4 font-mono text-caption leading-relaxed text-foreground",
57
60
  children: /* @__PURE__ */ jsx("code", {