@devalok/shilp-sutra 0.56.0 → 0.59.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 (374) hide show
  1. package/MIGRATION.md +198 -0
  2. package/dist/_chunks/badge-group.js +75 -174
  3. package/dist/_chunks/badge-group.js.map +1 -1
  4. package/dist/_chunks/chat.js +270 -253
  5. package/dist/_chunks/chat.js.map +1 -1
  6. package/dist/_chunks/document-preview.js +1 -1
  7. package/dist/_chunks/document-preview.js.map +1 -1
  8. package/dist/_chunks/emoji-suggestion.js +1 -1
  9. package/dist/_chunks/emoji-suggestion.js.map +1 -1
  10. package/dist/_chunks/image-preview.js +71 -70
  11. package/dist/_chunks/image-preview.js.map +1 -1
  12. package/dist/_chunks/mention-suggestion.js +2 -2
  13. package/dist/_chunks/mention-suggestion.js.map +1 -1
  14. package/dist/_chunks/motion-preference.js +15 -0
  15. package/dist/_chunks/motion-preference.js.map +1 -0
  16. package/dist/_chunks/motion-provider.js +1 -1
  17. package/dist/_chunks/motion-provider.js.map +1 -1
  18. package/dist/_chunks/oauth-button.js +1 -1
  19. package/dist/_chunks/oauth-button.js.map +1 -1
  20. package/dist/_chunks/popover.js +50 -49
  21. package/dist/_chunks/popover.js.map +1 -1
  22. package/dist/_chunks/primitives-internal.js +29 -29
  23. package/dist/_chunks/primitives-internal.js.map +1 -1
  24. package/dist/_chunks/shared.js +48 -47
  25. package/dist/_chunks/shared.js.map +1 -1
  26. package/dist/_chunks/success.js +36 -36
  27. package/dist/_chunks/success.js.map +1 -1
  28. package/dist/_chunks/tree-view.js +1 -1
  29. package/dist/_chunks/tree-view.js.map +1 -1
  30. package/dist/_chunks/use-calendar.js +4 -4
  31. package/dist/_chunks/use-calendar.js.map +1 -1
  32. package/dist/ai/block-renderer.js +8 -8
  33. package/dist/ai/blocks/text.js +1 -1
  34. package/dist/ai/blocks/text.js.map +1 -1
  35. package/dist/ai/command-bar.js +67 -67
  36. package/dist/ai/command-bar.js.map +1 -1
  37. package/dist/ai/conversation.js +35 -35
  38. package/dist/ai/conversation.js.map +1 -1
  39. package/dist/ai/index.js +4 -4
  40. package/dist/composed/activity-feed.d.ts.map +1 -1
  41. package/dist/composed/activity-feed.js +109 -108
  42. package/dist/composed/activity-feed.js.map +1 -1
  43. package/dist/composed/avatar-group.d.ts +7 -2
  44. package/dist/composed/avatar-group.d.ts.map +1 -1
  45. package/dist/composed/avatar-group.js +3 -3
  46. package/dist/composed/avatar-group.js.map +1 -1
  47. package/dist/composed/command-palette.js +137 -137
  48. package/dist/composed/command-palette.js.map +1 -1
  49. package/dist/composed/content-card.js +2 -2
  50. package/dist/composed/content-card.js.map +1 -1
  51. package/dist/composed/date-picker/index.js +9 -9
  52. package/dist/composed/date-picker/index.js.map +1 -1
  53. package/dist/composed/diff.d.ts +23 -2
  54. package/dist/composed/diff.d.ts.map +1 -1
  55. package/dist/composed/diff.js +341 -260
  56. package/dist/composed/diff.js.map +1 -1
  57. package/dist/composed/emoji-picker.js +3 -3
  58. package/dist/composed/emoji-picker.js.map +1 -1
  59. package/dist/composed/empty-state.js +4 -4
  60. package/dist/composed/error-boundary.js +2 -2
  61. package/dist/composed/error-boundary.js.map +1 -1
  62. package/dist/composed/file-preview/image-preview.d.ts.map +1 -1
  63. package/dist/composed/file-preview/shared.d.ts.map +1 -1
  64. package/dist/composed/file-preview/video-preview.d.ts.map +1 -1
  65. package/dist/composed/file-preview.js +152 -151
  66. package/dist/composed/file-preview.js.map +1 -1
  67. package/dist/composed/filter-bar.d.ts.map +1 -1
  68. package/dist/composed/filter-bar.js +53 -52
  69. package/dist/composed/filter-bar.js.map +1 -1
  70. package/dist/composed/form-section.d.ts.map +1 -1
  71. package/dist/composed/form-section.js +38 -37
  72. package/dist/composed/form-section.js.map +1 -1
  73. package/dist/composed/inline-edit.js +1 -1
  74. package/dist/composed/inline-edit.js.map +1 -1
  75. package/dist/composed/loading-skeleton.js +3 -3
  76. package/dist/composed/loading-skeleton.js.map +1 -1
  77. package/dist/composed/master-detail.d.ts.map +1 -1
  78. package/dist/composed/master-detail.js +1 -1
  79. package/dist/composed/master-detail.js.map +1 -1
  80. package/dist/composed/member-picker.js +1 -1
  81. package/dist/composed/member-picker.js.map +1 -1
  82. package/dist/composed/multi-select-popover.d.ts.map +1 -1
  83. package/dist/composed/multi-select-popover.js +109 -108
  84. package/dist/composed/multi-select-popover.js.map +1 -1
  85. package/dist/composed/page-skeletons.js +4 -4
  86. package/dist/composed/page-skeletons.js.map +1 -1
  87. package/dist/composed/responsive-modal.js +1 -1
  88. package/dist/composed/responsive-modal.js.map +1 -1
  89. package/dist/composed/rich-chat-input/attachment-strip.d.ts.map +1 -1
  90. package/dist/composed/rich-chat-input/reply-banner.d.ts.map +1 -1
  91. package/dist/composed/rich-chat-input/schedule-send.d.ts.map +1 -1
  92. package/dist/composed/rich-chat-input.d.ts.map +1 -1
  93. package/dist/composed/rich-chat-input.js +473 -472
  94. package/dist/composed/rich-chat-input.js.map +1 -1
  95. package/dist/composed/rich-text-editor.js +6 -6
  96. package/dist/composed/rich-text-editor.js.map +1 -1
  97. package/dist/composed/schedule-view.js +5 -5
  98. package/dist/composed/schedule-view.js.map +1 -1
  99. package/dist/composed/status-badge.d.ts.map +1 -1
  100. package/dist/composed/status-badge.js +29 -28
  101. package/dist/composed/status-badge.js.map +1 -1
  102. package/dist/hooks/index.d.ts +1 -0
  103. package/dist/hooks/index.d.ts.map +1 -1
  104. package/dist/hooks/index.js +4 -3
  105. package/dist/hooks/use-container-size.d.ts +18 -0
  106. package/dist/hooks/use-container-size.d.ts.map +1 -0
  107. package/dist/hooks/use-container-size.js +28 -0
  108. package/dist/hooks/use-container-size.js.map +1 -0
  109. package/dist/motion/index.d.ts +1 -0
  110. package/dist/motion/index.d.ts.map +1 -1
  111. package/dist/motion/index.js +2 -15
  112. package/dist/motion/motion-preference.d.ts +36 -0
  113. package/dist/motion/motion-preference.d.ts.map +1 -0
  114. package/dist/motion/motion-provider.d.ts +2 -1
  115. package/dist/motion/motion-provider.d.ts.map +1 -1
  116. package/dist/motion/primitives-index.js +103 -102
  117. package/dist/motion/primitives-index.js.map +1 -1
  118. package/dist/motion/primitives.d.ts.map +1 -1
  119. package/dist/shell/app-shell.d.ts +101 -0
  120. package/dist/shell/app-shell.d.ts.map +1 -0
  121. package/dist/shell/app-shell.js +76 -0
  122. package/dist/shell/app-shell.js.map +1 -0
  123. package/dist/shell/bottom-navbar.js +21 -21
  124. package/dist/shell/bottom-navbar.js.map +1 -1
  125. package/dist/shell/index.d.ts +2 -1
  126. package/dist/shell/index.d.ts.map +1 -1
  127. package/dist/shell/index.js +6 -5
  128. package/dist/shell/notification-center.d.ts +17 -0
  129. package/dist/shell/notification-center.d.ts.map +1 -1
  130. package/dist/shell/notification-center.js +110 -105
  131. package/dist/shell/notification-center.js.map +1 -1
  132. package/dist/shell/notification-preferences.js +1 -1
  133. package/dist/shell/notification-preferences.js.map +1 -1
  134. package/dist/shell/top-bar.js +7 -7
  135. package/dist/shell/top-bar.js.map +1 -1
  136. package/dist/tokens/generate-scale.d.ts +49 -0
  137. package/dist/tokens/generate-scale.d.ts.map +1 -1
  138. package/dist/tokens/index.css +1 -0
  139. package/dist/tokens/palettes.css +292 -0
  140. package/dist/tokens/primitives.css +29 -26
  141. package/dist/tokens/semantic.css +170 -47
  142. package/dist/tokens/shilp-sutra.css +1 -0
  143. package/dist/tokens/utilities.css +10 -7
  144. package/dist/tokens/variants.css +1 -1
  145. package/dist/ui/accordion.d.ts.map +1 -1
  146. package/dist/ui/accordion.js +27 -26
  147. package/dist/ui/accordion.js.map +1 -1
  148. package/dist/ui/alert-dialog.d.ts.map +1 -1
  149. package/dist/ui/alert-dialog.js +60 -59
  150. package/dist/ui/alert-dialog.js.map +1 -1
  151. package/dist/ui/alert.d.ts.map +1 -1
  152. package/dist/ui/alert.js +55 -113
  153. package/dist/ui/alert.js.map +1 -1
  154. package/dist/ui/autocomplete.js +80 -80
  155. package/dist/ui/autocomplete.js.map +1 -1
  156. package/dist/ui/avatar.d.ts.map +1 -1
  157. package/dist/ui/avatar.js +71 -70
  158. package/dist/ui/avatar.js.map +1 -1
  159. package/dist/ui/badge-indicator.d.ts +4 -8
  160. package/dist/ui/badge-indicator.d.ts.map +1 -1
  161. package/dist/ui/badge-indicator.js +3 -8
  162. package/dist/ui/badge-indicator.js.map +1 -1
  163. package/dist/ui/badge.d.ts +55 -34
  164. package/dist/ui/badge.d.ts.map +1 -1
  165. package/dist/ui/banner.d.ts.map +1 -1
  166. package/dist/ui/banner.js +43 -41
  167. package/dist/ui/banner.js.map +1 -1
  168. package/dist/ui/button-group.d.ts.map +1 -1
  169. package/dist/ui/button-group.js +3 -23
  170. package/dist/ui/button-group.js.map +1 -1
  171. package/dist/ui/button.d.ts +10 -1
  172. package/dist/ui/button.d.ts.map +1 -1
  173. package/dist/ui/button.js +79 -212
  174. package/dist/ui/button.js.map +1 -1
  175. package/dist/ui/card.d.ts.map +1 -1
  176. package/dist/ui/card.js +78 -75
  177. package/dist/ui/card.js.map +1 -1
  178. package/dist/ui/charts/radar-chart.d.ts.map +1 -1
  179. package/dist/ui/charts/radar-chart.js +1 -1
  180. package/dist/ui/charts/radar-chart.js.map +1 -1
  181. package/dist/ui/chat/date-separator.d.ts +8 -1
  182. package/dist/ui/chat/date-separator.d.ts.map +1 -1
  183. package/dist/ui/chat/message-list.d.ts.map +1 -1
  184. package/dist/ui/chat/message.d.ts.map +1 -1
  185. package/dist/ui/chat/typing-indicator.d.ts.map +1 -1
  186. package/dist/ui/checkbox.js +1 -1
  187. package/dist/ui/checkbox.js.map +1 -1
  188. package/dist/ui/code.js +2 -2
  189. package/dist/ui/code.js.map +1 -1
  190. package/dist/ui/color-input.d.ts.map +1 -1
  191. package/dist/ui/color-input.js +151 -150
  192. package/dist/ui/color-input.js.map +1 -1
  193. package/dist/ui/combobox.d.ts +14 -0
  194. package/dist/ui/combobox.d.ts.map +1 -1
  195. package/dist/ui/combobox.js +156 -152
  196. package/dist/ui/combobox.js.map +1 -1
  197. package/dist/ui/context-menu.d.ts.map +1 -1
  198. package/dist/ui/context-menu.js +70 -69
  199. package/dist/ui/context-menu.js.map +1 -1
  200. package/dist/ui/data-table-body.d.ts +3 -1
  201. package/dist/ui/data-table-body.d.ts.map +1 -1
  202. package/dist/ui/data-table-body.js +93 -92
  203. package/dist/ui/data-table-body.js.map +1 -1
  204. package/dist/ui/data-table-bulk-actions.d.ts +7 -1
  205. package/dist/ui/data-table-bulk-actions.d.ts.map +1 -1
  206. package/dist/ui/data-table-bulk-actions.js +14 -8
  207. package/dist/ui/data-table-bulk-actions.js.map +1 -1
  208. package/dist/ui/data-table-card.d.ts.map +1 -1
  209. package/dist/ui/data-table-card.js +66 -47
  210. package/dist/ui/data-table-card.js.map +1 -1
  211. package/dist/ui/data-table-context.d.ts +4 -0
  212. package/dist/ui/data-table-context.d.ts.map +1 -1
  213. package/dist/ui/data-table-context.js +2 -2
  214. package/dist/ui/data-table-context.js.map +1 -1
  215. package/dist/ui/data-table-header.d.ts.map +1 -1
  216. package/dist/ui/data-table-header.js +50 -46
  217. package/dist/ui/data-table-header.js.map +1 -1
  218. package/dist/ui/data-table-pagination.js +3 -3
  219. package/dist/ui/data-table-pagination.js.map +1 -1
  220. package/dist/ui/data-table-toolbar.d.ts +11 -1
  221. package/dist/ui/data-table-toolbar.d.ts.map +1 -1
  222. package/dist/ui/data-table-toolbar.js +7 -7
  223. package/dist/ui/data-table-toolbar.js.map +1 -1
  224. package/dist/ui/data-table.d.ts +52 -5
  225. package/dist/ui/data-table.d.ts.map +1 -1
  226. package/dist/ui/data-table.js +181 -169
  227. package/dist/ui/data-table.js.map +1 -1
  228. package/dist/ui/dialog.d.ts.map +1 -1
  229. package/dist/ui/dialog.js +62 -61
  230. package/dist/ui/dialog.js.map +1 -1
  231. package/dist/ui/dot.d.ts.map +1 -1
  232. package/dist/ui/dot.js +10 -41
  233. package/dist/ui/dot.js.map +1 -1
  234. package/dist/ui/dropdown-menu.d.ts.map +1 -1
  235. package/dist/ui/dropdown-menu.js +79 -78
  236. package/dist/ui/dropdown-menu.js.map +1 -1
  237. package/dist/ui/file-upload.d.ts.map +1 -1
  238. package/dist/ui/file-upload.js +117 -116
  239. package/dist/ui/file-upload.js.map +1 -1
  240. package/dist/ui/form.d.ts.map +1 -1
  241. package/dist/ui/form.js +27 -26
  242. package/dist/ui/form.js.map +1 -1
  243. package/dist/ui/hover-card.d.ts.map +1 -1
  244. package/dist/ui/hover-card.js +26 -25
  245. package/dist/ui/hover-card.js.map +1 -1
  246. package/dist/ui/icon.js +7 -7
  247. package/dist/ui/index.d.ts +2 -2
  248. package/dist/ui/index.d.ts.map +1 -1
  249. package/dist/ui/index.js +3 -3
  250. package/dist/ui/index.js.map +1 -1
  251. package/dist/ui/input-otp.js +1 -1
  252. package/dist/ui/input-otp.js.map +1 -1
  253. package/dist/ui/input.js +8 -8
  254. package/dist/ui/input.js.map +1 -1
  255. package/dist/ui/menubar.d.ts.map +1 -1
  256. package/dist/ui/menubar.js +73 -72
  257. package/dist/ui/menubar.js.map +1 -1
  258. package/dist/ui/navigation-menu.d.ts.map +1 -1
  259. package/dist/ui/navigation-menu.js +80 -79
  260. package/dist/ui/navigation-menu.js.map +1 -1
  261. package/dist/ui/number-input.js +3 -3
  262. package/dist/ui/number-input.js.map +1 -1
  263. package/dist/ui/pagination.js +1 -1
  264. package/dist/ui/pagination.js.map +1 -1
  265. package/dist/ui/popover.d.ts.map +1 -1
  266. package/dist/ui/progress-ring.js +2 -2
  267. package/dist/ui/progress-ring.js.map +1 -1
  268. package/dist/ui/progress.d.ts.map +1 -1
  269. package/dist/ui/progress.js +82 -74
  270. package/dist/ui/progress.js.map +1 -1
  271. package/dist/ui/radio.d.ts.map +1 -1
  272. package/dist/ui/radio.js +32 -31
  273. package/dist/ui/radio.js.map +1 -1
  274. package/dist/ui/search-input.d.ts.map +1 -1
  275. package/dist/ui/search-input.js +28 -27
  276. package/dist/ui/search-input.js.map +1 -1
  277. package/dist/ui/select.d.ts.map +1 -1
  278. package/dist/ui/select.js +67 -66
  279. package/dist/ui/select.js.map +1 -1
  280. package/dist/ui/sheet.js +1 -1
  281. package/dist/ui/sheet.js.map +1 -1
  282. package/dist/ui/sidebar.d.ts.map +1 -1
  283. package/dist/ui/sidebar.js +14 -14
  284. package/dist/ui/sidebar.js.map +1 -1
  285. package/dist/ui/slider.d.ts +63 -9
  286. package/dist/ui/slider.d.ts.map +1 -1
  287. package/dist/ui/slider.js +75 -33
  288. package/dist/ui/slider.js.map +1 -1
  289. package/dist/ui/split-button.d.ts +8 -2
  290. package/dist/ui/split-button.d.ts.map +1 -1
  291. package/dist/ui/split-button.js +49 -95
  292. package/dist/ui/split-button.js.map +1 -1
  293. package/dist/ui/stat-card.d.ts.map +1 -1
  294. package/dist/ui/stat-card.js +89 -88
  295. package/dist/ui/stat-card.js.map +1 -1
  296. package/dist/ui/stat-flash.js +16 -16
  297. package/dist/ui/stepper.d.ts.map +1 -1
  298. package/dist/ui/stepper.js +63 -62
  299. package/dist/ui/stepper.js.map +1 -1
  300. package/dist/ui/surface.d.ts.map +1 -1
  301. package/dist/ui/surface.js +2 -2
  302. package/dist/ui/surface.js.map +1 -1
  303. package/dist/ui/switch.js +1 -1
  304. package/dist/ui/switch.js.map +1 -1
  305. package/dist/ui/table.js +3 -3
  306. package/dist/ui/table.js.map +1 -1
  307. package/dist/ui/tabs.d.ts.map +1 -1
  308. package/dist/ui/tabs.js +68 -67
  309. package/dist/ui/tabs.js.map +1 -1
  310. package/dist/ui/textarea.js +5 -5
  311. package/dist/ui/textarea.js.map +1 -1
  312. package/dist/ui/toast.d.ts.map +1 -1
  313. package/dist/ui/toast.js +196 -195
  314. package/dist/ui/toast.js.map +1 -1
  315. package/dist/ui/toggle.d.ts.map +1 -1
  316. package/dist/ui/toggle.js +26 -24
  317. package/dist/ui/toggle.js.map +1 -1
  318. package/dist/ui/tooltip.d.ts.map +1 -1
  319. package/dist/ui/tooltip.js +37 -36
  320. package/dist/ui/tooltip.js.map +1 -1
  321. package/dist/ui/tree-view/tree-item.d.ts.map +1 -1
  322. package/docs/components/composed/avatar-group.md +4 -4
  323. package/docs/components/composed/diff.md +10 -2
  324. package/docs/components/composed/schedule-view.md +1 -1
  325. package/docs/components/shell/app-shell.md +132 -0
  326. package/docs/components/ui/avatar.md +1 -1
  327. package/docs/components/ui/button.md +1 -1
  328. package/docs/components/ui/chat.md +7 -1
  329. package/docs/components/ui/color-swatch.md +1 -1
  330. package/docs/components/ui/data-table-toolbar.md +6 -2
  331. package/docs/components/ui/data-table.md +41 -7
  332. package/docs/components/ui/dot.md +1 -1
  333. package/docs/components/ui/progress.md +1 -0
  334. package/docs/components/ui/surface.md +3 -3
  335. package/docs/components/ui/table.md +2 -2
  336. package/docs/recipes/customize-brand.md +58 -0
  337. package/docs/recipes/install-astro.md +1 -0
  338. package/docs/recipes/install-next-app-router.md +1 -0
  339. package/docs/recipes/install-next-pages.md +22 -1
  340. package/docs/recipes/install-remix.md +1 -0
  341. package/docs/recipes/install-tanstack-start.md +1 -0
  342. package/docs/recipes/install-vite.md +2 -0
  343. package/docs/recipes/server-components.md +7 -4
  344. package/docs/recipes/troubleshoot.md +1 -0
  345. package/llms.txt +2 -1
  346. package/make-kit/Guidelines.md +2 -2
  347. package/make-kit/components/button.md +1 -1
  348. package/make-kit/components/card.md +6 -6
  349. package/make-kit/components/surface.md +4 -4
  350. package/make-kit/foundations/color.md +4 -4
  351. package/make-kit/foundations/dark-mode.md +1 -1
  352. package/make-kit/foundations/radius.md +1 -1
  353. package/make-kit/foundations/surfaces.md +9 -9
  354. package/mcp-manifest.json +358 -35
  355. package/package.json +8 -4
  356. package/skill/SKILL.md +12 -6
  357. package/skill/references/components.md +2 -1
  358. package/skill/references/customize-brand.md +58 -0
  359. package/skill/references/server-components.md +7 -4
  360. package/skill/references/setup-astro.md +1 -0
  361. package/skill/references/setup-next-app-router.md +1 -0
  362. package/skill/references/setup-next-pages.md +22 -1
  363. package/skill/references/setup-remix.md +1 -0
  364. package/skill/references/setup-tanstack-start.md +1 -0
  365. package/skill/references/setup-vite.md +2 -0
  366. package/skill/references/troubleshoot.md +1 -0
  367. package/dist/motion/check-motion-provider.d.ts +0 -2
  368. package/dist/motion/check-motion-provider.d.ts.map +0 -1
  369. package/dist/motion/index.js.map +0 -1
  370. package/dist/primitives/react-toast.d.ts +0 -120
  371. package/dist/ui/charts/_internal/scales.d.ts +0 -5
  372. package/dist/ui/charts/_internal/scales.d.ts.map +0 -1
  373. package/dist/ui/lib/slot.d.ts +0 -8
  374. package/dist/ui/lib/slot.d.ts.map +0 -1
@@ -1,296 +1,313 @@
1
1
  "use client";
2
- import { IconProvider as e } from "../ui/icon-context.js";
3
- import { motionProps as t, springs as n, tweens as r } from "../ui/lib/motion.js";
4
- import { cn as i } from "../ui/lib/utils.js";
5
- import { Spinner as a } from "../ui/spinner.js";
6
- import { Icon as o } from "../ui/icon.js";
7
- import { Avatar as s, AvatarFallback as c, AvatarImage as l } from "../ui/avatar.js";
8
- import { normalizeIcon as u } from "./normalize-icon.js";
9
- import { Button as d } from "../ui/button.js";
10
- import { Textarea as f } from "../ui/textarea.js";
11
- import { Tooltip as p, TooltipContent as m, TooltipTrigger as h } from "../ui/tooltip.js";
12
- import { MENTION_TOKEN_CLASS as g } from "./mention.js";
13
- import * as _ from "react";
14
- import { jsx as v, jsxs as y } from "react/jsx-runtime";
15
- import { IconAlertCircle as b, IconSend as x, IconSquare as S, IconTrash as C } from "@tabler/icons-react";
16
- import { AnimatePresence as w, motion as T } from "framer-motion";
2
+ import { motionProps as e, springs as t, tweens as n } from "../ui/lib/motion.js";
3
+ import { MotionPreference as r } from "./motion-preference.js";
4
+ import { IconProvider as i } from "../ui/icon-context.js";
5
+ import { cn as a } from "../ui/lib/utils.js";
6
+ import { Spinner as o } from "../ui/spinner.js";
7
+ import { Icon as s } from "../ui/icon.js";
8
+ import { Avatar as c, AvatarFallback as l, AvatarImage as u } from "../ui/avatar.js";
9
+ import { normalizeIcon as d } from "./normalize-icon.js";
10
+ import { Button as f } from "../ui/button.js";
11
+ import { Textarea as p } from "../ui/textarea.js";
12
+ import { Tooltip as m, TooltipContent as h, TooltipTrigger as g } from "../ui/tooltip.js";
13
+ import { MENTION_TOKEN_CLASS as _ } from "./mention.js";
14
+ import * as v from "react";
15
+ import { jsx as y, jsxs as b } from "react/jsx-runtime";
16
+ import { IconAlertCircle as x, IconSend as S, IconSquare as C, IconTrash as w } from "@tabler/icons-react";
17
+ import { AnimatePresence as T, motion as E } from "framer-motion";
17
18
  //#region src/ui/chat/date-separator.tsx
18
- function E(e) {
19
- let t = /* @__PURE__ */ new Date(), n = new Date(t.getFullYear(), t.getMonth(), t.getDate()), r = new Date(e.getFullYear(), e.getMonth(), e.getDate()), i = n.getTime() - r.getTime(), a = Math.round(i / (1e3 * 60 * 60 * 24));
20
- if (a === 0) return "Today";
21
- if (a === 1) return "Yesterday";
22
- let o = e.toLocaleString("en-US", { month: "short" }), s = e.getDate();
23
- return e.getFullYear() === t.getFullYear() ? `${o} ${s}` : `${o} ${s}, ${e.getFullYear()}`;
19
+ function D(e, t) {
20
+ let n = new Intl.DateTimeFormat("en-US", {
21
+ timeZone: t,
22
+ year: "numeric",
23
+ month: "2-digit",
24
+ day: "2-digit"
25
+ }).formatToParts(e), r = (e) => Number(n.find((t) => t.type === e)?.value);
26
+ return {
27
+ year: r("year"),
28
+ month: r("month"),
29
+ day: r("day")
30
+ };
24
31
  }
25
- function D({ date: e, format: t, className: n }) {
26
- let r = typeof e == "string" ? new Date(e) : e, a = t ? t(r) : E(r);
27
- return /* @__PURE__ */ y("div", {
28
- className: i("flex items-center gap-ds-03 py-ds-03", n),
32
+ function O(e, t, n) {
33
+ let r = D(/* @__PURE__ */ new Date(), n), i = D(e, n), a = Date.UTC(r.year, r.month - 1, r.day), o = Date.UTC(i.year, i.month - 1, i.day), s = Math.round((a - o) / (1e3 * 60 * 60 * 24));
34
+ if (s === 0) return "Today";
35
+ if (s === 1) return "Yesterday";
36
+ let c = e.toLocaleString(t, {
37
+ month: "short",
38
+ timeZone: n
39
+ });
40
+ return i.year === r.year ? `${c} ${i.day}` : `${c} ${i.day}, ${i.year}`;
41
+ }
42
+ function k({ date: e, format: t, className: n, locale: r = "en-US", timeZone: i }) {
43
+ let o = typeof e == "string" ? new Date(e) : e, s = t ? t(o) : O(o, r, i);
44
+ return /* @__PURE__ */ b("div", {
45
+ className: a("flex items-center gap-ds-03 py-ds-03", n),
29
46
  children: [
30
- /* @__PURE__ */ v("div", { className: "flex-1 border-t border-surface-border-subtle" }),
31
- /* @__PURE__ */ v("span", {
32
- className: "text-label-xs font-medium text-surface-fg-subtle/50 uppercase tracking-wider",
33
- children: a
47
+ /* @__PURE__ */ y("div", { className: "flex-1 border-t border-surface-border-subtle" }),
48
+ /* @__PURE__ */ y("span", {
49
+ className: "text-label-xs font-medium text-surface-fg-subtle uppercase tracking-wider",
50
+ children: s
34
51
  }),
35
- /* @__PURE__ */ v("div", { className: "flex-1 border-t border-surface-border-subtle" })
52
+ /* @__PURE__ */ y("div", { className: "flex-1 border-t border-surface-border-subtle" })
36
53
  ]
37
54
  });
38
55
  }
39
- D.displayName = "DateSeparator";
56
+ k.displayName = "DateSeparator";
40
57
  //#endregion
41
58
  //#region src/ui/chat/message.tsx
42
- var O = _.createContext({
59
+ var A = v.createContext({
43
60
  variant: "flat",
44
61
  placement: "start",
45
62
  grouped: !1
46
63
  });
47
- function k() {
48
- return _.useContext(O);
64
+ function j() {
65
+ return v.useContext(A);
49
66
  }
50
- var A = _.forwardRef(({ children: e, variant: r = "flat", placement: a = "start", highlight: s, grouped: c = !1, deleted: l = !1, deletedText: u = "This message was deleted", className: d, ...f }, p) => {
51
- let m = _.useMemo(() => ({
52
- variant: r,
53
- placement: a,
54
- grouped: c,
55
- highlight: s
67
+ var M = v.forwardRef(({ children: n, variant: i = "flat", placement: o = "start", highlight: c, grouped: l = !1, deleted: u = !1, deletedText: d = "This message was deleted", className: f, ...p }, m) => {
68
+ let h = v.useMemo(() => ({
69
+ variant: i,
70
+ placement: o,
71
+ grouped: l,
72
+ highlight: c
56
73
  }), [
57
- r,
58
- a,
59
- c,
60
- s
74
+ i,
75
+ o,
76
+ l,
77
+ c
61
78
  ]);
62
- return l ? /* @__PURE__ */ y(T.div, {
63
- ref: p,
79
+ return u ? /* @__PURE__ */ y(r, { children: /* @__PURE__ */ b(E.div, {
80
+ ref: m,
64
81
  initial: { y: 8 },
65
82
  animate: {
66
83
  opacity: 1,
67
84
  y: 0
68
85
  },
69
- transition: n.snappy,
70
- className: i("flex items-center gap-ds-02 py-ds-02 text-caption text-surface-fg-subtle/50 italic", d),
71
- ...t(f),
72
- children: [/* @__PURE__ */ v(o, {
73
- icon: C,
86
+ transition: t.snappy,
87
+ className: a("flex items-center gap-ds-02 py-ds-02 text-caption text-surface-fg-subtle italic", f),
88
+ ...e(p),
89
+ children: [/* @__PURE__ */ y(s, {
90
+ icon: w,
74
91
  size: "xs"
75
- }), u]
76
- }) : r === "bubble" ? /* @__PURE__ */ v(O.Provider, {
77
- value: m,
78
- children: /* @__PURE__ */ v(T.div, {
79
- ref: p,
80
- "data-highlight": s,
92
+ }), d]
93
+ }) }) : i === "bubble" ? /* @__PURE__ */ y(r, { children: /* @__PURE__ */ y(A.Provider, {
94
+ value: h,
95
+ children: /* @__PURE__ */ y(E.div, {
96
+ ref: m,
97
+ "data-highlight": c,
81
98
  initial: { y: 8 },
82
99
  animate: {
83
100
  opacity: 1,
84
101
  y: 0
85
102
  },
86
- transition: n.snappy,
87
- className: i("group/message relative flex", a === "end" ? "justify-end" : "justify-start", g, s === "internal" && "bg-warning-2/50 rounded-control-inner", d),
88
- ...t(f),
89
- children: /* @__PURE__ */ v("div", {
90
- className: i("max-w-[85%] rounded-bubble px-ds-04 py-ds-03", a === "end" ? "bg-accent-3 text-surface-fg" : "bg-surface-raised text-surface-fg"),
91
- children: e
103
+ transition: t.snappy,
104
+ className: a("group/message relative flex", o === "end" ? "justify-end" : "justify-start", _, c === "internal" && "bg-warning-2/50 rounded-control-inner", f),
105
+ ...e(p),
106
+ children: /* @__PURE__ */ y("div", {
107
+ className: a("max-w-[85%] rounded-bubble px-ds-04 py-ds-03", o === "end" ? "bg-accent-3 text-surface-fg" : "bg-surface-panel text-surface-fg"),
108
+ children: n
92
109
  })
93
110
  })
94
- }) : /* @__PURE__ */ v(O.Provider, {
95
- value: m,
96
- children: /* @__PURE__ */ v(T.div, {
97
- ref: p,
98
- "data-highlight": s,
111
+ }) }) : /* @__PURE__ */ y(r, { children: /* @__PURE__ */ y(A.Provider, {
112
+ value: h,
113
+ children: /* @__PURE__ */ y(E.div, {
114
+ ref: m,
115
+ "data-highlight": c,
99
116
  initial: { y: 8 },
100
117
  animate: {
101
118
  opacity: 1,
102
119
  y: 0
103
120
  },
104
- transition: n.snappy,
105
- className: i("group/message relative flex gap-ds-04", c && "-mt-ds-01", g, s === "internal" && "bg-warning-2/50 rounded-control-inner", d),
106
- ...t(f),
107
- children: e
121
+ transition: t.snappy,
122
+ className: a("group/message relative flex gap-ds-04", l && "-mt-ds-01", _, c === "internal" && "bg-warning-2/50 rounded-control-inner", f),
123
+ ...e(p),
124
+ children: n
108
125
  })
109
- });
126
+ }) });
110
127
  });
111
- A.displayName = "Message";
112
- function j({ src: t, fallback: n, icon: r, size: a = "md", children: o }) {
113
- let { grouped: d } = k(), f = a === "sm" ? "w-5" : "w-6";
114
- return d ? /* @__PURE__ */ v("div", { className: i(f, a === "sm" ? "h-5" : "h-6", "shrink-0") }) : o ? /* @__PURE__ */ v("div", {
115
- className: i(f, "shrink-0 flex items-start"),
128
+ M.displayName = "Message";
129
+ function N({ src: e, fallback: t, icon: n, size: r = "md", children: o }) {
130
+ let { grouped: s } = j(), f = r === "sm" ? "w-5" : "w-6";
131
+ return s ? /* @__PURE__ */ y("div", { className: a(f, r === "sm" ? "h-5" : "h-6", "shrink-0") }) : o ? /* @__PURE__ */ y("div", {
132
+ className: a(f, "shrink-0 flex items-start"),
116
133
  children: o
117
- }) : r ? /* @__PURE__ */ v("div", {
118
- className: i(f, a === "sm" ? "h-5" : "h-6", "shrink-0 flex items-center justify-center rounded-pill bg-surface-raised-hover"),
119
- children: /* @__PURE__ */ v(e, {
120
- size: a === "sm" ? "xs" : "sm",
121
- children: u(r)
134
+ }) : n ? /* @__PURE__ */ y("div", {
135
+ className: a(f, r === "sm" ? "h-5" : "h-6", "shrink-0 flex items-center justify-center rounded-pill bg-surface-panel-hover"),
136
+ children: /* @__PURE__ */ y(i, {
137
+ size: r === "sm" ? "xs" : "sm",
138
+ children: d(n)
122
139
  })
123
- }) : /* @__PURE__ */ v("div", {
124
- className: i(f, "shrink-0"),
125
- children: /* @__PURE__ */ y(s, {
126
- size: a === "sm" ? "xs" : "sm",
127
- children: [t && /* @__PURE__ */ v(l, {
128
- src: t,
129
- alt: n ?? ""
130
- }), /* @__PURE__ */ v(c, { children: n ?? "" })]
140
+ }) : /* @__PURE__ */ y("div", {
141
+ className: a(f, "shrink-0"),
142
+ children: /* @__PURE__ */ b(c, {
143
+ size: r === "sm" ? "xs" : "sm",
144
+ children: [e && /* @__PURE__ */ y(u, {
145
+ src: e,
146
+ alt: t ?? ""
147
+ }), /* @__PURE__ */ y(l, { children: t ?? "" })]
131
148
  })
132
149
  });
133
150
  }
134
- j.displayName = "Message.Avatar";
135
- function M({ children: e, className: t, ...n }) {
136
- return /* @__PURE__ */ v("div", {
137
- className: i("min-w-0 flex-1 flex flex-col gap-ds-02", t),
151
+ N.displayName = "Message.Avatar";
152
+ function P({ children: e, className: t, ...n }) {
153
+ return /* @__PURE__ */ y("div", {
154
+ className: a("min-w-0 flex-1 flex flex-col gap-ds-02", t),
138
155
  ...n,
139
156
  children: e
140
157
  });
141
158
  }
142
- M.displayName = "Message.Content";
143
- function N(e) {
159
+ P.displayName = "Message.Content";
160
+ function F(e) {
144
161
  return e.toLocaleTimeString("en-US", {
145
162
  hour: "numeric",
146
163
  minute: "2-digit"
147
164
  });
148
165
  }
149
- function P({ name: e, badge: t, timestamp: n, formattedTimestamp: r, timestampFormat: i = N }) {
150
- let { grouped: a } = k();
166
+ function I({ name: e, badge: t, timestamp: n, formattedTimestamp: r, timestampFormat: i = F }) {
167
+ let { grouped: a } = j();
151
168
  if (a) return null;
152
169
  let o = r ?? (n ? i(n) : void 0);
153
- return /* @__PURE__ */ y("div", {
170
+ return /* @__PURE__ */ b("div", {
154
171
  className: "flex items-baseline gap-ds-02",
155
172
  children: [
156
- /* @__PURE__ */ v("span", {
173
+ /* @__PURE__ */ y("span", {
157
174
  className: "font-semibold text-body-md text-surface-fg",
158
175
  children: e
159
176
  }),
160
177
  t,
161
- o && /* @__PURE__ */ v("span", {
162
- className: "text-body-sm text-surface-fg-subtle/50",
178
+ o && /* @__PURE__ */ y("span", {
179
+ className: "text-body-sm text-surface-fg-subtle",
163
180
  children: o
164
181
  })
165
182
  ]
166
183
  });
167
184
  }
168
- P.displayName = "Message.Author";
169
- function F({ children: e, className: t, ...n }) {
170
- return /* @__PURE__ */ v("div", {
171
- className: i("text-body-md leading-relaxed text-surface-fg whitespace-pre-wrap", t),
185
+ I.displayName = "Message.Author";
186
+ function L({ children: e, className: t, ...n }) {
187
+ return /* @__PURE__ */ y("div", {
188
+ className: a("text-body-md leading-relaxed text-surface-fg whitespace-pre-wrap", t),
172
189
  ...n,
173
190
  children: e
174
191
  });
175
192
  }
176
- F.displayName = "Message.Body";
177
- function I({ content: e, onSave: t, onCancel: n, canEdit: r = !1, renderContent: a }) {
178
- let [o, s] = _.useState(!1), [c, l] = _.useState(e), u = _.useRef(null);
179
- _.useEffect(() => {
193
+ L.displayName = "Message.Body";
194
+ function R({ content: e, onSave: t, onCancel: n, canEdit: r = !1, renderContent: i }) {
195
+ let [o, s] = v.useState(!1), [c, l] = v.useState(e), u = v.useRef(null);
196
+ v.useEffect(() => {
180
197
  o && u.current && (u.current.focus(), u.current.select());
181
198
  }, [o]);
182
- let d = _.useCallback(() => {
199
+ let d = v.useCallback(() => {
183
200
  r && (l(e), s(!0));
184
- }, [r, e]), p = _.useCallback(() => {
201
+ }, [r, e]), f = v.useCallback(() => {
185
202
  let n = c.trim();
186
203
  n && n !== e && t(n), s(!1);
187
204
  }, [
188
205
  c,
189
206
  e,
190
207
  t
191
- ]), m = _.useCallback(() => {
208
+ ]), m = v.useCallback(() => {
192
209
  s(!1), l(e), n?.();
193
- }, [e, n]), h = _.useCallback((e) => {
194
- e.key === "Enter" && !e.shiftKey ? (e.preventDefault(), p()) : e.key === "Escape" && (e.preventDefault(), m());
195
- }, [p, m]);
196
- return o ? /* @__PURE__ */ y("div", {
210
+ }, [e, n]), h = v.useCallback((e) => {
211
+ e.key === "Enter" && !e.shiftKey ? (e.preventDefault(), f()) : e.key === "Escape" && (e.preventDefault(), m());
212
+ }, [f, m]);
213
+ return o ? /* @__PURE__ */ b("div", {
197
214
  className: "text-body-md leading-relaxed",
198
- children: [/* @__PURE__ */ v(f, {
215
+ children: [/* @__PURE__ */ y(p, {
199
216
  ref: u,
200
217
  value: c,
201
218
  onChange: (e) => l(e.target.value),
202
219
  onKeyDown: h,
203
- onBlur: p,
204
- className: "resize-none rounded-control-inner bg-surface-raised-hover px-ds-02 py-ds-01 text-body-md leading-relaxed",
220
+ onBlur: f,
221
+ className: "resize-none rounded-control-inner bg-surface-panel-hover px-ds-02 py-ds-01 text-body-md leading-relaxed",
205
222
  rows: 2
206
- }), /* @__PURE__ */ v("div", {
207
- className: "mt-ds-01 text-caption text-surface-fg-subtle/50",
223
+ }), /* @__PURE__ */ y("div", {
224
+ className: "mt-ds-01 text-caption text-surface-fg-subtle",
208
225
  children: "Enter to save · Escape to cancel"
209
226
  })]
210
- }) : /* @__PURE__ */ v("div", {
211
- className: i("text-body-md leading-relaxed text-surface-fg whitespace-pre-wrap", r && "cursor-pointer hover:bg-surface-raised-hover rounded-control-inner transition-colors"),
227
+ }) : /* @__PURE__ */ y("div", {
228
+ className: a("text-body-md leading-relaxed text-surface-fg whitespace-pre-wrap", r && "cursor-pointer hover:bg-surface-panel-hover rounded-control-inner transition-colors"),
212
229
  onClick: d,
213
230
  role: r ? "button" : void 0,
214
231
  tabIndex: r ? 0 : void 0,
215
232
  onKeyDown: r ? (e) => {
216
233
  (e.key === "Enter" || e.key === " ") && (e.preventDefault(), d());
217
234
  } : void 0,
218
- children: a ? a(e) : e
235
+ children: i ? i(e) : e
219
236
  });
220
237
  }
221
- I.displayName = "Message.EditableBody";
222
- function L({ reactions: e, onReact: t }) {
223
- return e.length === 0 ? null : /* @__PURE__ */ v("div", {
238
+ R.displayName = "Message.EditableBody";
239
+ function z({ reactions: e, onReact: t }) {
240
+ return e.length === 0 ? null : /* @__PURE__ */ y("div", {
224
241
  className: "flex flex-wrap gap-ds-02 mt-ds-03",
225
- children: e.map((e) => /* @__PURE__ */ y("button", {
242
+ children: e.map((e) => /* @__PURE__ */ b("button", {
226
243
  type: "button",
227
244
  onClick: () => t(e.emoji),
228
245
  "aria-label": `${e.emoji} ${e.count} reaction${e.count === 1 ? "" : "s"}${e.reacted ? ", you reacted" : ""}`,
229
- className: i("inline-flex items-center gap-ds-01 rounded-pill px-ds-02 py-ds-01 text-body-xs transition-colors", e.reacted ? "bg-accent-3 ring-1 ring-accent-6" : "bg-surface-raised-hover hover:bg-surface-raised-active"),
230
- children: [/* @__PURE__ */ v("span", { children: e.emoji }), /* @__PURE__ */ v("span", { children: e.count })]
246
+ className: a("inline-flex items-center gap-ds-01 rounded-pill px-ds-02 py-ds-01 text-body-xs transition-colors", e.reacted ? "bg-accent-4 ring-1 ring-accent-6" : "bg-surface-panel-hover hover:bg-surface-panel-active"),
247
+ children: [/* @__PURE__ */ y("span", { children: e.emoji }), /* @__PURE__ */ y("span", { children: e.count })]
231
248
  }, e.emoji))
232
249
  });
233
250
  }
234
- L.displayName = "Message.Reactions";
235
- function R({ children: e, delay: t = 100 }) {
236
- return /* @__PURE__ */ v("div", {
237
- className: i("absolute -top-2 right-0 z-10", "flex items-center gap-ds-01 rounded-control bg-surface-raised px-ds-01 py-ds-01 shadow-raised", "opacity-0 group-hover/message:opacity-100 group-focus-within/message:opacity-100 transition-opacity duration-150"),
251
+ z.displayName = "Message.Reactions";
252
+ function B({ children: e, delay: t = 100 }) {
253
+ return /* @__PURE__ */ y("div", {
254
+ className: a("absolute -top-2 right-0 z-10", "flex items-center gap-ds-01 rounded-control bg-surface-panel px-ds-01 py-ds-01 shadow-raised", "opacity-0 group-hover/message:opacity-100 group-focus-within/message:opacity-100 transition-opacity duration-150"),
238
255
  style: { transitionDelay: `${t}ms` },
239
256
  children: e
240
257
  });
241
258
  }
242
- R.displayName = "Message.Actions";
243
- function z({ icon: t, label: n, onClick: r, variant: a = "default" }) {
244
- return /* @__PURE__ */ y(p, { children: [/* @__PURE__ */ v(h, {
259
+ B.displayName = "Message.Actions";
260
+ function V({ icon: e, label: t, onClick: n, variant: r = "default" }) {
261
+ return /* @__PURE__ */ b(m, { children: [/* @__PURE__ */ y(g, {
245
262
  asChild: !0,
246
- children: /* @__PURE__ */ v("button", {
263
+ children: /* @__PURE__ */ y("button", {
247
264
  type: "button",
248
- onClick: r,
249
- "aria-label": n,
250
- className: i("p-ds-02 rounded-control-inner transition-colors", a === "default" && "text-surface-fg-subtle hover:text-surface-fg hover:bg-surface-raised-hover", a === "danger" && "text-surface-fg-subtle hover:text-error-11 hover:bg-surface-raised-hover"),
251
- children: /* @__PURE__ */ v(e, {
265
+ onClick: n,
266
+ "aria-label": t,
267
+ className: a("p-ds-02 rounded-control-inner transition-colors", r === "default" && "text-surface-fg-subtle hover:text-surface-fg hover:bg-surface-panel-hover", r === "danger" && "text-surface-fg-subtle hover:text-error-11 hover:bg-surface-panel-hover"),
268
+ children: /* @__PURE__ */ y(i, {
252
269
  size: "xs",
253
- children: u(t)
270
+ children: d(e)
254
271
  })
255
272
  })
256
- }), /* @__PURE__ */ v(m, { children: n })] });
273
+ }), /* @__PURE__ */ y(h, { children: t })] });
257
274
  }
258
- z.displayName = "Message.Action";
259
- var B = Object.assign(A, {
260
- Avatar: j,
261
- Content: M,
262
- Author: P,
263
- Body: F,
264
- EditableBody: I,
265
- Reactions: L,
266
- Actions: R,
267
- Action: z
268
- }), V = _.forwardRef(({ onSubmit: e, placeholder: t = "Type a message...", disabled: n = !1, isStreaming: r = !1, onCancel: a, leadingSlot: s, trailingSlot: c, disclaimer: l, sendIcon: u, className: f, ...p }, m) => {
269
- let [h, g] = _.useState(""), b = _.useRef(null), C = _.useCallback(() => {
270
- let e = b.current;
275
+ V.displayName = "Message.Action";
276
+ var H = Object.assign(M, {
277
+ Avatar: N,
278
+ Content: P,
279
+ Author: I,
280
+ Body: L,
281
+ EditableBody: R,
282
+ Reactions: z,
283
+ Actions: B,
284
+ Action: V
285
+ }), U = v.forwardRef(({ onSubmit: e, placeholder: t = "Type a message...", disabled: n = !1, isStreaming: r = !1, onCancel: i, leadingSlot: o, trailingSlot: c, disclaimer: l, sendIcon: u, className: d, ...p }, m) => {
286
+ let [h, g] = v.useState(""), _ = v.useRef(null), x = v.useCallback(() => {
287
+ let e = _.current;
271
288
  e && (e.style.height = "auto", e.style.height = `${Math.min(e.scrollHeight, 160)}px`);
272
- }, []), w = _.useCallback((e) => {
273
- g(e.target.value), C();
274
- }, [C]), T = _.useCallback(() => {
289
+ }, []), w = v.useCallback((e) => {
290
+ g(e.target.value), x();
291
+ }, [x]), T = v.useCallback(() => {
275
292
  let t = h.trim();
276
- !t || r || (e(t), g(""), b.current && (b.current.style.height = "auto"));
293
+ !t || r || (e(t), g(""), _.current && (_.current.style.height = "auto"));
277
294
  }, [
278
295
  h,
279
296
  r,
280
297
  e
281
- ]), E = _.useCallback((e) => {
298
+ ]), E = v.useCallback((e) => {
282
299
  e.key === "Enter" && !e.shiftKey && (e.preventDefault(), r || T());
283
300
  }, [r, T]), D = h.trim().length === 0;
284
- return /* @__PURE__ */ y("div", {
301
+ return /* @__PURE__ */ b("div", {
285
302
  ref: m,
286
- className: i("border-t border-surface-border-subtle px-ds-05 py-ds-04", f),
303
+ className: a("border-t border-surface-border-subtle px-ds-05 py-ds-04", d),
287
304
  ...p,
288
- children: [/* @__PURE__ */ y("div", {
289
- className: "flex items-end gap-ds-02 rounded-overlay-lg border border-surface-border bg-surface-base p-ds-03",
305
+ children: [/* @__PURE__ */ b("div", {
306
+ className: "flex items-end gap-ds-02 rounded-overlay-lg border border-surface-border-interactive bg-surface-panel-hover p-ds-03",
290
307
  children: [
291
- s,
292
- /* @__PURE__ */ v("textarea", {
293
- ref: b,
308
+ o,
309
+ /* @__PURE__ */ y("textarea", {
310
+ ref: _,
294
311
  value: h,
295
312
  onChange: w,
296
313
  onKeyDown: E,
@@ -298,78 +315,78 @@ var B = Object.assign(A, {
298
315
  "aria-label": t || "Type a message",
299
316
  disabled: n,
300
317
  rows: 1,
301
- className: "flex-1 resize-none bg-transparent px-ds-02 py-ds-01 text-body-sm text-surface-fg placeholder:text-surface-fg-subtle/50 focus:outline-hidden disabled:opacity-50",
318
+ className: "flex-1 resize-none bg-transparent px-ds-02 py-ds-01 text-body-sm text-surface-fg placeholder:text-surface-fg-muted focus:outline-hidden disabled:opacity-50",
302
319
  style: { maxHeight: 160 }
303
320
  }),
304
- r ? /* @__PURE__ */ v(d, {
321
+ r ? /* @__PURE__ */ y(f, {
305
322
  variant: "ghost",
306
323
  size: "icon-sm",
307
324
  color: "error",
308
- onClick: a,
325
+ onClick: i,
309
326
  "aria-label": "Stop",
310
- children: /* @__PURE__ */ v(o, {
311
- icon: S,
327
+ children: /* @__PURE__ */ y(s, {
328
+ icon: C,
312
329
  size: "sm"
313
330
  })
314
- }) : /* @__PURE__ */ v(d, {
331
+ }) : /* @__PURE__ */ y(f, {
315
332
  variant: "ghost",
316
333
  size: "icon-sm",
317
334
  onClick: T,
318
335
  disabled: D || n,
319
336
  "aria-label": "Send",
320
- children: u ?? /* @__PURE__ */ v(o, {
321
- icon: x,
337
+ children: u ?? /* @__PURE__ */ y(s, {
338
+ icon: S,
322
339
  size: "sm"
323
340
  })
324
341
  }),
325
342
  c
326
343
  ]
327
- }), l && /* @__PURE__ */ v("p", {
328
- className: "mt-ds-02 text-center text-caption text-surface-fg-subtle/50",
344
+ }), l && /* @__PURE__ */ y("p", {
345
+ className: "mt-ds-02 text-center text-caption text-surface-fg-subtle",
329
346
  children: l
330
347
  })]
331
348
  });
332
349
  });
333
- V.displayName = "MessageInput";
350
+ U.displayName = "MessageInput";
334
351
  //#endregion
335
352
  //#region src/ui/chat/message-list.tsx
336
- var H = _.forwardRef(({ children: e, autoScroll: t = !0, newMessageCount: n = 0, onScrollToBottom: o, onLoadMore: s, loadingMore: c = !1, emptySlot: l, scrollToBottomSlot: u, headerSlot: d, className: f, ...p }, m) => {
337
- let h = _.useRef(null), g = _.useRef(!0), [b, x] = _.useState(!0), S = _.useRef(!1), C = _.useRef(0), E = _.Children.count(e) === 0 && !c, D = _.useCallback(() => {
338
- let e = h.current;
353
+ var W = v.forwardRef(({ children: e, autoScroll: t = !0, newMessageCount: i = 0, onScrollToBottom: s, onLoadMore: c, loadingMore: l = !1, emptySlot: u, scrollToBottomSlot: d, headerSlot: f, className: p, ...m }, h) => {
354
+ let g = v.useRef(null), _ = v.useRef(!0), [x, S] = v.useState(!0), C = v.useRef(!1), w = v.useRef(0), D = v.Children.count(e) === 0 && !l, O = v.useCallback(() => {
355
+ let e = g.current;
339
356
  if (!e) return;
340
357
  let t = e.scrollHeight - e.scrollTop - e.clientHeight < 40;
341
- g.current = t, x(t), e.scrollTop < 100 && s && !S.current && (S.current = !0, C.current = e.scrollHeight, s());
342
- }, [s]);
343
- _.useLayoutEffect(() => {
344
- let e = h.current;
358
+ _.current = t, S(t), e.scrollTop < 100 && c && !C.current && (C.current = !0, w.current = e.scrollHeight, c());
359
+ }, [c]);
360
+ v.useLayoutEffect(() => {
361
+ let e = g.current;
345
362
  if (e) {
346
- if (S.current) {
347
- e.scrollTop = e.scrollHeight - C.current, S.current = !1;
363
+ if (C.current) {
364
+ e.scrollTop = e.scrollHeight - w.current, C.current = !1;
348
365
  return;
349
366
  }
350
- t && g.current && e.scrollTo({
367
+ t && _.current && e.scrollTo({
351
368
  top: e.scrollHeight,
352
369
  behavior: "smooth"
353
370
  });
354
371
  }
355
- }, [e, t]), _.useEffect(() => {
356
- c || (S.current = !1);
357
- }, [c]);
358
- let O = n > 0 && !b, k = _.useCallback(() => {
359
- let e = h.current;
372
+ }, [e, t]), v.useEffect(() => {
373
+ l || (C.current = !1);
374
+ }, [l]);
375
+ let k = i > 0 && !x, A = v.useCallback(() => {
376
+ let e = g.current;
360
377
  e && e.scrollTo({
361
378
  top: e.scrollHeight,
362
379
  behavior: "smooth"
363
- }), o?.();
364
- }, [o]);
365
- return /* @__PURE__ */ y("div", {
366
- ref: m,
367
- className: i("relative flex flex-1 flex-col overflow-hidden", f),
368
- ...p,
380
+ }), s?.();
381
+ }, [s]);
382
+ return /* @__PURE__ */ y(r, { children: /* @__PURE__ */ b("div", {
383
+ ref: h,
384
+ className: a("relative flex flex-1 flex-col overflow-hidden", p),
385
+ ...m,
369
386
  children: [
370
- d,
371
- /* @__PURE__ */ y("div", {
372
- ref: h,
387
+ f,
388
+ /* @__PURE__ */ b("div", {
389
+ ref: g,
373
390
  role: "log",
374
391
  "aria-live": "polite",
375
392
  "aria-relevant": "additions",
@@ -378,19 +395,19 @@ var H = _.forwardRef(({ children: e, autoScroll: t = !0, newMessageCount: n = 0,
378
395
  scrollbarWidth: "thin",
379
396
  scrollbarColor: "var(--color-surface-border) transparent"
380
397
  },
381
- onScroll: D,
382
- children: [c && /* @__PURE__ */ v("div", {
398
+ onScroll: O,
399
+ children: [l && /* @__PURE__ */ y("div", {
383
400
  className: "flex justify-center py-ds-03",
384
- children: /* @__PURE__ */ v(a, { size: "sm" })
385
- }), E ? l : /* @__PURE__ */ v("div", {
401
+ children: /* @__PURE__ */ y(o, { size: "sm" })
402
+ }), D ? u : /* @__PURE__ */ y("div", {
386
403
  className: "flex flex-col gap-ds-04",
387
- children: /* @__PURE__ */ v(w, {
404
+ children: /* @__PURE__ */ y(T, {
388
405
  initial: !1,
389
406
  children: e
390
407
  })
391
408
  })]
392
409
  }),
393
- /* @__PURE__ */ v(w, { children: O && /* @__PURE__ */ y(T.button, {
410
+ /* @__PURE__ */ y(T, { children: k && /* @__PURE__ */ b(E.button, {
394
411
  initial: {
395
412
  opacity: 0,
396
413
  y: 10
@@ -403,84 +420,84 @@ var H = _.forwardRef(({ children: e, autoScroll: t = !0, newMessageCount: n = 0,
403
420
  opacity: 0,
404
421
  y: 10
405
422
  },
406
- transition: r.fade,
407
- onClick: k,
423
+ transition: n.fade,
424
+ onClick: A,
408
425
  className: "absolute bottom-ds-04 left-1/2 z-10 -translate-x-1/2 rounded-pill bg-accent-9 px-ds-04 py-ds-02 text-body-xs font-medium text-accent-fg shadow-raised transition-colors hover:bg-accent-10",
409
- children: [n, " new"]
426
+ children: [i, " new"]
410
427
  }) })
411
428
  ]
412
- });
429
+ }) });
413
430
  });
414
- H.displayName = "MessageList";
431
+ W.displayName = "MessageList";
415
432
  //#endregion
416
433
  //#region src/ui/chat/system-message.tsx
417
- function U(e) {
434
+ function G(e) {
418
435
  return new Date(e).toLocaleTimeString("en-US", {
419
436
  hour: "numeric",
420
437
  minute: "2-digit"
421
438
  });
422
439
  }
423
- var W = _.forwardRef(({ icon: t, timestamp: n, variant: r = "event", children: a, className: s, ...c }, l) => r === "alert" ? /* @__PURE__ */ v("div", {
440
+ var K = v.forwardRef(({ icon: e, timestamp: t, variant: n = "event", children: r, className: o, ...c }, l) => n === "alert" ? /* @__PURE__ */ y("div", {
424
441
  ref: l,
425
442
  role: "alert",
426
- className: i("flex justify-center", s),
443
+ className: a("flex justify-center", o),
427
444
  ...c,
428
- children: /* @__PURE__ */ y("div", {
445
+ children: /* @__PURE__ */ b("div", {
429
446
  className: "flex items-center gap-ds-03 rounded-surface bg-error-3 px-ds-04 py-ds-03",
430
447
  children: [
431
- /* @__PURE__ */ v(e, {
448
+ /* @__PURE__ */ y(i, {
432
449
  size: "sm",
433
- children: u(t) ?? /* @__PURE__ */ v(o, { icon: b })
450
+ children: d(e) ?? /* @__PURE__ */ y(s, { icon: x })
434
451
  }),
435
- /* @__PURE__ */ v("span", {
452
+ /* @__PURE__ */ y("span", {
436
453
  className: "text-body-sm text-error-11",
437
- children: a
454
+ children: r
438
455
  }),
439
- n && /* @__PURE__ */ v("span", {
456
+ t && /* @__PURE__ */ y("span", {
440
457
  className: "text-body-sm text-error-11/60",
441
- children: U(n)
458
+ children: G(t)
442
459
  })
443
460
  ]
444
461
  })
445
- }) : /* @__PURE__ */ y("div", {
462
+ }) : /* @__PURE__ */ b("div", {
446
463
  ref: l,
447
- className: i("flex items-center gap-ds-02 rounded-control-inner bg-surface-raised-hover/30 px-ds-02 py-ds-01 -mx-ds-02 text-body-sm text-surface-fg-subtle/60", s),
464
+ className: a("flex items-center gap-ds-02 rounded-control-inner bg-surface-panel-hover/30 px-ds-02 py-ds-01 -mx-ds-02 text-body-sm text-surface-fg-subtle", o),
448
465
  ...c,
449
466
  children: [
450
- /* @__PURE__ */ v(e, {
467
+ /* @__PURE__ */ y(i, {
451
468
  size: "xs",
452
- children: u(t)
469
+ children: d(e)
453
470
  }),
454
- /* @__PURE__ */ v("span", {
471
+ /* @__PURE__ */ y("span", {
455
472
  className: "flex-1",
456
- children: a
473
+ children: r
457
474
  }),
458
- n && /* @__PURE__ */ v("span", { children: U(n) })
475
+ t && /* @__PURE__ */ y("span", { children: G(t) })
459
476
  ]
460
477
  }));
461
- W.displayName = "SystemMessage";
478
+ K.displayName = "SystemMessage";
462
479
  //#endregion
463
480
  //#region src/ui/chat/typing-indicator.tsx
464
- function G(e) {
481
+ function q(e) {
465
482
  return e.length === 1 ? `${e[0].name} is typing...` : e.length === 2 ? `${e[0].name} and ${e[1].name} are typing...` : "Several people are typing...";
466
483
  }
467
- function K({ users: e, className: t }) {
468
- return /* @__PURE__ */ v("div", {
469
- className: i("min-h-ds-06 px-ds-05", t),
484
+ function J({ users: e, className: t }) {
485
+ return /* @__PURE__ */ y(r, { children: /* @__PURE__ */ y("div", {
486
+ className: a("min-h-ds-06 px-ds-05", t),
470
487
  role: "status",
471
488
  "aria-live": "polite",
472
- children: /* @__PURE__ */ v(w, { children: e.length > 0 && /* @__PURE__ */ y(T.div, {
489
+ children: /* @__PURE__ */ y(T, { children: e.length > 0 && /* @__PURE__ */ b(E.div, {
473
490
  initial: { opacity: 0 },
474
491
  animate: { opacity: 1 },
475
492
  exit: { opacity: 0 },
476
493
  className: "flex items-center gap-ds-02 text-caption text-surface-fg-subtle",
477
- children: [/* @__PURE__ */ v("span", {
494
+ children: [/* @__PURE__ */ y("span", {
478
495
  className: "flex items-center gap-ds-01",
479
496
  children: [
480
497
  0,
481
498
  1,
482
499
  2
483
- ].map((e) => /* @__PURE__ */ v(T.span, {
500
+ ].map((e) => /* @__PURE__ */ y(E.span, {
484
501
  className: "h-1 w-1 rounded-pill bg-surface-fg-subtle",
485
502
  animate: { y: [
486
503
  0,
@@ -493,26 +510,26 @@ function K({ users: e, className: t }) {
493
510
  delay: e * .15
494
511
  }
495
512
  }, e))
496
- }), /* @__PURE__ */ v("span", { children: G(e) })]
513
+ }), /* @__PURE__ */ y("span", { children: q(e) })]
497
514
  }) })
498
- });
515
+ }) });
499
516
  }
500
- K.displayName = "TypingIndicator";
517
+ J.displayName = "TypingIndicator";
501
518
  //#endregion
502
519
  //#region src/ui/chat/unread-separator.tsx
503
- function q({ label: e = "NEW", count: t, className: n }) {
504
- return /* @__PURE__ */ y("div", {
505
- className: i("relative flex items-center py-ds-02", n),
520
+ function Y({ label: e = "NEW", count: t, className: n }) {
521
+ return /* @__PURE__ */ b("div", {
522
+ className: a("relative flex items-center py-ds-02", n),
506
523
  children: [
507
- /* @__PURE__ */ v("div", { className: "flex-1 border-t-2 border-accent-7" }),
508
- /* @__PURE__ */ v("span", {
524
+ /* @__PURE__ */ y("div", { className: "flex-1 border-t-2 border-accent-7" }),
525
+ /* @__PURE__ */ y("span", {
509
526
  className: "px-ds-03 text-body-xs font-semibold text-accent-11",
510
527
  children: t ? `${t} ${e}` : e
511
528
  }),
512
- /* @__PURE__ */ v("div", { className: "flex-1 border-t-2 border-accent-7" })
529
+ /* @__PURE__ */ y("div", { className: "flex-1 border-t-2 border-accent-7" })
513
530
  ]
514
531
  });
515
532
  }
516
- q.displayName = "UnreadSeparator";
533
+ Y.displayName = "UnreadSeparator";
517
534
  //#endregion
518
- export { D as DateSeparator, B as Message, V as MessageInput, H as MessageList, W as SystemMessage, K as TypingIndicator, q as UnreadSeparator, k as useMessageContext };
535
+ export { k as DateSeparator, H as Message, U as MessageInput, W as MessageList, K as SystemMessage, J as TypingIndicator, Y as UnreadSeparator, j as useMessageContext };