@ctrl-ui/react 0.8.2 → 0.8.4

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 (373) hide show
  1. package/README.md +32 -23
  2. package/dist/action-bar.d.ts +11 -12
  3. package/dist/activity.d.ts +24 -25
  4. package/dist/audio-recorder.d.ts +16 -16
  5. package/dist/audio-visualizer.d.ts +3 -4
  6. package/dist/blocks/chat.d.ts +3 -4
  7. package/dist/blocks/chat.js +6 -3
  8. package/dist/blocks/coding-agent.d.ts +11 -12
  9. package/dist/blocks/coding-agent.js +10 -9
  10. package/dist/blocks/file-explorer-data.d.ts +11 -12
  11. package/dist/blocks/file-explorer.d.ts +3 -3
  12. package/dist/blocks/settings-data.d.ts +8 -9
  13. package/dist/blocks/settings.d.ts +4 -4
  14. package/dist/blocks/theme-toggle.d.ts +11 -12
  15. package/dist/blocks/theme-toggle.js +14 -4
  16. package/dist/chat-composer-attachment.d.ts +20 -21
  17. package/dist/chat-composer-attachment.js +24 -20
  18. package/dist/chat-composer-editor/extensions/mention.d.ts +5 -6
  19. package/dist/chat-composer-editor/ghost.d.ts +3 -4
  20. package/dist/chat-composer-editor/schema.d.ts +2 -3
  21. package/dist/chat-composer-editor/serialize.d.ts +3 -4
  22. package/dist/chat-composer-editor/types.d.ts +5 -6
  23. package/dist/chat-composer-editor.d.ts +2 -3
  24. package/dist/chat-composer-editor.js +18 -4
  25. package/dist/chat-composer.d.ts +17 -18
  26. package/dist/chat-composer.js +14 -8
  27. package/dist/chat-layout.d.ts +12 -21
  28. package/dist/chat-layout.js +28 -83
  29. package/dist/chat-message.d.ts +14 -15
  30. package/dist/context-model.d.ts +7 -8
  31. package/dist/context.d.ts +21 -22
  32. package/dist/control-props.d.ts +10 -11
  33. package/dist/control-variants.d.ts +6 -7
  34. package/dist/dynamic-notification-glass.d.ts +3 -4
  35. package/dist/dynamic-notification-liquid.d.ts +3 -4
  36. package/dist/dynamic-notification-siri-wave.d.ts +2 -3
  37. package/dist/dynamic-notification.d.ts +28 -29
  38. package/dist/email/email.d.ts +6 -7
  39. package/dist/email/length.d.ts +2 -3
  40. package/dist/email/templates.d.ts +7 -8
  41. package/dist/email/theme.d.ts +4 -5
  42. package/dist/environment-variables.d.ts +35 -36
  43. package/dist/extensions/create-track-highlight.d.ts +3 -4
  44. package/dist/extensions/supports-anchor-transitions.d.ts +2 -3
  45. package/dist/extensions/track-highlight.d.ts +3 -4
  46. package/dist/hooks/use-audio-recorder.d.ts +14 -15
  47. package/dist/hooks/use-chat-composer.d.ts +5 -6
  48. package/dist/hooks/use-chat-message.d.ts +7 -8
  49. package/dist/hooks/use-color-area.d.ts +5 -6
  50. package/dist/hooks/use-copy-to-clipboard.d.ts +7 -8
  51. package/dist/hooks/use-dropzone.d.ts +11 -12
  52. package/dist/hooks/use-dynamic-notification.d.ts +6 -7
  53. package/dist/hooks/use-environment-variables.d.ts +9 -10
  54. package/dist/hooks/use-keyboard-navigation.d.ts +3 -0
  55. package/dist/hooks/use-keyboard-navigation.js +22 -0
  56. package/dist/hooks/use-mobile.d.ts +2 -3
  57. package/dist/hooks/use-textarea-trigger-menu.d.ts +2 -3
  58. package/dist/hooks/use-trigger-menu.d.ts +7 -8
  59. package/dist/hooks/use-user-ask.d.ts +6 -7
  60. package/dist/inline-attachment.d.ts +16 -17
  61. package/dist/inline-citation.d.ts +22 -23
  62. package/dist/knob-contracts/accordion-knobs.d.ts +3 -4
  63. package/dist/knob-contracts/accordion-knobs.js +1 -0
  64. package/dist/knob-contracts/action-bar-knobs.d.ts +3 -4
  65. package/dist/knob-contracts/activity-knobs.d.ts +3 -4
  66. package/dist/knob-contracts/alert-knobs.d.ts +3 -4
  67. package/dist/knob-contracts/alert-knobs.js +12 -1
  68. package/dist/knob-contracts/audio-recorder-knobs.d.ts +3 -4
  69. package/dist/knob-contracts/audio-visualizer-knobs.d.ts +3 -4
  70. package/dist/knob-contracts/avatar-knobs.d.ts +3 -4
  71. package/dist/knob-contracts/avatar-knobs.js +2 -1
  72. package/dist/knob-contracts/badge-knobs.d.ts +3 -4
  73. package/dist/knob-contracts/button-group-knobs.d.ts +3 -4
  74. package/dist/knob-contracts/button-knobs.d.ts +3 -4
  75. package/dist/knob-contracts/button-knobs.js +1 -0
  76. package/dist/knob-contracts/calendar-knobs.d.ts +3 -4
  77. package/dist/knob-contracts/card-knobs.d.ts +3 -4
  78. package/dist/knob-contracts/chat-composer-attachment-knobs.d.ts +3 -4
  79. package/dist/knob-contracts/chat-composer-attachment-knobs.js +3 -1
  80. package/dist/knob-contracts/chat-composer-knobs.d.ts +3 -4
  81. package/dist/knob-contracts/chat-composer-knobs.js +1 -0
  82. package/dist/knob-contracts/chat-layout-knobs.d.ts +3 -4
  83. package/dist/knob-contracts/chat-layout-knobs.js +2 -3
  84. package/dist/knob-contracts/chat-message-knobs.d.ts +3 -4
  85. package/dist/knob-contracts/choice-knobs.d.ts +3 -4
  86. package/dist/knob-contracts/choice-knobs.js +2 -1
  87. package/dist/knob-contracts/code-diff-knobs.d.ts +3 -4
  88. package/dist/knob-contracts/code-diff-knobs.js +1 -0
  89. package/dist/knob-contracts/code-knobs.d.ts +3 -4
  90. package/dist/knob-contracts/code-knobs.js +3 -1
  91. package/dist/knob-contracts/collapsible-knobs.d.ts +3 -4
  92. package/dist/knob-contracts/color-picker-knobs.d.ts +3 -4
  93. package/dist/knob-contracts/context-knobs.d.ts +3 -4
  94. package/dist/knob-contracts/dockable-panel-knobs.d.ts +3 -4
  95. package/dist/knob-contracts/dockable-panel-knobs.js +1 -0
  96. package/dist/knob-contracts/dropzone-knobs.d.ts +3 -4
  97. package/dist/knob-contracts/dropzone-knobs.js +1 -0
  98. package/dist/knob-contracts/dynamic-notification-knobs.d.ts +3 -4
  99. package/dist/knob-contracts/empty-knobs.d.ts +3 -4
  100. package/dist/knob-contracts/empty-knobs.js +14 -1
  101. package/dist/knob-contracts/environment-variables-knobs.d.ts +3 -4
  102. package/dist/knob-contracts/environment-variables-knobs.js +2 -1
  103. package/dist/knob-contracts/field-knobs.d.ts +3 -4
  104. package/dist/knob-contracts/gradient-editor-knobs.d.ts +3 -4
  105. package/dist/knob-contracts/gradient-editor-knobs.js +3 -1
  106. package/dist/knob-contracts/infinite-canvas-knobs.d.ts +3 -4
  107. package/dist/knob-contracts/inline-attachment-knobs.d.ts +3 -4
  108. package/dist/knob-contracts/inline-attachment-knobs.js +2 -1
  109. package/dist/knob-contracts/inline-citation-knobs.d.ts +3 -4
  110. package/dist/knob-contracts/inline-citation-knobs.js +1 -0
  111. package/dist/knob-contracts/item-knobs.d.ts +3 -4
  112. package/dist/knob-contracts/kbd-knobs.d.ts +3 -4
  113. package/dist/knob-contracts/markdown-block-knobs.d.ts +3 -4
  114. package/dist/knob-contracts/markdown-block-knobs.js +2 -0
  115. package/dist/knob-contracts/markdown-knobs.d.ts +3 -4
  116. package/dist/knob-contracts/markdown-knobs.js +1 -0
  117. package/dist/knob-contracts/morphing-panel-knobs.d.ts +3 -4
  118. package/dist/knob-contracts/pagination-knobs.d.ts +3 -4
  119. package/dist/knob-contracts/phone-input-knobs.d.ts +3 -4
  120. package/dist/knob-contracts/phone-input-knobs.js +1 -0
  121. package/dist/knob-contracts/popup-knobs.d.ts +3 -4
  122. package/dist/knob-contracts/progressive-blur-knobs.d.ts +3 -4
  123. package/dist/knob-contracts/progressive-blur-knobs.js +1 -0
  124. package/dist/knob-contracts/range-knobs.d.ts +3 -4
  125. package/dist/knob-contracts/resizable-knobs.d.ts +3 -4
  126. package/dist/knob-contracts/resizable-knobs.js +1 -0
  127. package/dist/knob-contracts/rich-tooltip-knobs.d.ts +3 -4
  128. package/dist/knob-contracts/scroll-area-knobs.d.ts +3 -4
  129. package/dist/knob-contracts/separator-knobs.d.ts +3 -4
  130. package/dist/knob-contracts/sidebar-knobs.d.ts +3 -4
  131. package/dist/knob-contracts/sidebar-knobs.js +1 -0
  132. package/dist/knob-contracts/skeleton-knobs.d.ts +3 -4
  133. package/dist/knob-contracts/skeleton-knobs.js +9 -1
  134. package/dist/knob-contracts/source-badge-knobs.d.ts +3 -4
  135. package/dist/knob-contracts/spinner-knobs.d.ts +3 -4
  136. package/dist/knob-contracts/stepper-knobs.d.ts +3 -4
  137. package/dist/knob-contracts/stepper-knobs.js +1 -0
  138. package/dist/knob-contracts/switch-knobs.d.ts +3 -4
  139. package/dist/knob-contracts/switch-knobs.js +7 -1
  140. package/dist/knob-contracts/table-knobs.d.ts +3 -4
  141. package/dist/knob-contracts/table-of-contents-knobs.d.ts +3 -4
  142. package/dist/knob-contracts/table-of-contents-knobs.js +25 -0
  143. package/dist/knob-contracts/tabs-knobs.d.ts +3 -4
  144. package/dist/knob-contracts/tabs-knobs.js +2 -1
  145. package/dist/knob-contracts/task-list-knobs.d.ts +3 -4
  146. package/dist/knob-contracts/task-list-knobs.js +1 -0
  147. package/dist/knob-contracts/thread-rail-knobs.d.ts +3 -4
  148. package/dist/knob-contracts/timeline-knobs.d.ts +3 -4
  149. package/dist/knob-contracts/toolbar-knobs.d.ts +3 -4
  150. package/dist/knob-contracts/toolbar-knobs.js +1 -0
  151. package/dist/knob-contracts/track-highlight-knobs.d.ts +3 -4
  152. package/dist/knob-contracts/transcript-divider-knobs.d.ts +3 -4
  153. package/dist/knob-contracts/tree-knobs.d.ts +3 -4
  154. package/dist/knob-contracts/user-ask-knobs.d.ts +3 -4
  155. package/dist/knob-contracts/user-ask-knobs.js +1 -0
  156. package/dist/lib/cn.d.ts +2 -3
  157. package/dist/lib/code-tokens.d.ts +12 -13
  158. package/dist/lib/color.d.ts +26 -27
  159. package/dist/lib/contrast.d.ts +12 -13
  160. package/dist/lib/diff.d.ts +14 -15
  161. package/dist/lib/dropzone-validation.d.ts +25 -26
  162. package/dist/lib/env-file.d.ts +12 -13
  163. package/dist/lib/format-audio-recorder-duration.d.ts +2 -3
  164. package/dist/lib/liquid-glass-optics.d.ts +2 -3
  165. package/dist/lib/phone-input-format.d.ts +3 -4
  166. package/dist/lib/phone-input-format.js +1 -1
  167. package/dist/lib/phone-number.d.ts +8 -9
  168. package/dist/lib/trigger-detect.d.ts +4 -5
  169. package/dist/markdown-block.d.ts +11 -12
  170. package/dist/scripts/contrast-eval.d.ts +16 -17
  171. package/dist/scripts/contrast-eval.js +13 -7
  172. package/dist/skin-provider.d.ts +14 -0
  173. package/dist/skin-provider.js +21 -0
  174. package/dist/skin.d.ts +14 -33
  175. package/dist/skin.js +3 -46
  176. package/dist/source-badge.d.ts +7 -8
  177. package/dist/styles/index.css +1 -4
  178. package/dist/styles/recipes/accordion.css +8 -2
  179. package/dist/styles/recipes/action-bar.css +5 -2
  180. package/dist/styles/recipes/alert.css +95 -16
  181. package/dist/styles/recipes/avatar.css +17 -1
  182. package/dist/styles/recipes/badge.css +0 -1
  183. package/dist/styles/recipes/button.css +34 -8
  184. package/dist/styles/recipes/calendar.css +0 -6
  185. package/dist/styles/recipes/chat-composer-attachment.css +51 -53
  186. package/dist/styles/recipes/chat-composer.css +26 -21
  187. package/dist/styles/recipes/chat-layout.css +21 -62
  188. package/dist/styles/recipes/chat-message.css +11 -5
  189. package/dist/styles/recipes/choice.css +9 -2
  190. package/dist/styles/recipes/code-diff.css +8 -1
  191. package/dist/styles/recipes/code.css +39 -17
  192. package/dist/styles/recipes/collapsible.css +0 -3
  193. package/dist/styles/recipes/color-picker-details.css +1 -2
  194. package/dist/styles/recipes/color-picker-values.css +0 -4
  195. package/dist/styles/recipes/dockable-panel.css +8 -1
  196. package/dist/styles/recipes/dropzone.css +9 -2
  197. package/dist/styles/recipes/empty.css +118 -17
  198. package/dist/styles/recipes/environment-variables.css +8 -1
  199. package/dist/styles/recipes/field-parts.css +1 -6
  200. package/dist/styles/recipes/field.css +9 -5
  201. package/dist/styles/recipes/gradient-editor.css +16 -5
  202. package/dist/styles/recipes/inline-attachment.css +13 -8
  203. package/dist/styles/recipes/inline-citation.css +8 -4
  204. package/dist/styles/recipes/item.css +1 -1
  205. package/dist/styles/recipes/kbd.css +8 -0
  206. package/dist/styles/recipes/markdown-block.css +16 -2
  207. package/dist/styles/recipes/markdown.css +12 -0
  208. package/dist/styles/recipes/morphing-panel.css +1 -1
  209. package/dist/styles/recipes/pagination.css +0 -4
  210. package/dist/styles/recipes/phone-input.css +8 -4
  211. package/dist/styles/recipes/popup-lists.css +11 -0
  212. package/dist/styles/recipes/popup-toast.css +1 -29
  213. package/dist/styles/recipes/popup.css +2 -2
  214. package/dist/styles/recipes/progressive-blur.css +28 -7
  215. package/dist/styles/recipes/range.css +50 -1
  216. package/dist/styles/recipes/resizable.css +8 -10
  217. package/dist/styles/recipes/rich-tooltip.css +0 -4
  218. package/dist/styles/recipes/scroll-area.css +8 -2
  219. package/dist/styles/recipes/sidebar-menu.css +0 -6
  220. package/dist/styles/recipes/sidebar.css +56 -17
  221. package/dist/styles/recipes/skeleton.css +85 -3
  222. package/dist/styles/recipes/source-badge.css +0 -3
  223. package/dist/styles/recipes/stepper.css +8 -1
  224. package/dist/styles/recipes/switch.css +89 -17
  225. package/dist/styles/recipes/table-of-contents.css +211 -45
  226. package/dist/styles/recipes/table.css +0 -1
  227. package/dist/styles/recipes/tabs.css +19 -2
  228. package/dist/styles/recipes/task-list.css +8 -2
  229. package/dist/styles/recipes/thread-rail.css +0 -4
  230. package/dist/styles/recipes/toolbar.css +18 -4
  231. package/dist/styles/recipes/track-highlight.css +63 -5
  232. package/dist/styles/recipes/tree.css +2 -0
  233. package/dist/styles/recipes/user-ask.css +8 -4
  234. package/dist/styles/theme.css +130 -138
  235. package/dist/surface-variants.d.ts +4 -5
  236. package/dist/task-list.d.ts +16 -17
  237. package/dist/thread-rail.d.ts +21 -22
  238. package/dist/transcript-divider.d.ts +6 -7
  239. package/dist/ui/accordion.d.ts +10 -11
  240. package/dist/ui/alert-dialog.d.ts +11 -12
  241. package/dist/ui/alert-dialog.js +8 -6
  242. package/dist/ui/alert.d.ts +9 -10
  243. package/dist/ui/alert.js +3 -3
  244. package/dist/ui/aspect-ratio.d.ts +3 -4
  245. package/dist/ui/autocomplete.d.ts +19 -20
  246. package/dist/ui/autocomplete.js +5 -3
  247. package/dist/ui/avatar.d.ts +9 -10
  248. package/dist/ui/badge.d.ts +9 -10
  249. package/dist/ui/button-group.d.ts +7 -8
  250. package/dist/ui/button-group.js +3 -2
  251. package/dist/ui/button.d.ts +17 -18
  252. package/dist/ui/button.js +20 -5
  253. package/dist/ui/calendar.d.ts +3 -4
  254. package/dist/ui/card.d.ts +16 -17
  255. package/dist/ui/checkbox-group.d.ts +4 -5
  256. package/dist/ui/checkbox-group.js +3 -2
  257. package/dist/ui/checkbox.d.ts +3 -4
  258. package/dist/ui/code-diff.d.ts +8 -9
  259. package/dist/ui/code.d.ts +32 -23
  260. package/dist/ui/code.js +41 -20
  261. package/dist/ui/collapsible.d.ts +7 -8
  262. package/dist/ui/color-picker.d.ts +40 -41
  263. package/dist/ui/color-picker.js +6 -4
  264. package/dist/ui/combobox-disabled-selection.d.ts +3 -4
  265. package/dist/ui/combobox.d.ts +19 -20
  266. package/dist/ui/combobox.js +5 -3
  267. package/dist/ui/command.d.ts +19 -18
  268. package/dist/ui/command.js +38 -12
  269. package/dist/ui/context-menu.d.ts +30 -31
  270. package/dist/ui/context-menu.js +8 -5
  271. package/dist/ui/dialog.d.ts +13 -13
  272. package/dist/ui/dialog.js +10 -8
  273. package/dist/ui/dockable-panel-geometry.d.ts +7 -8
  274. package/dist/ui/dockable-panel.d.ts +21 -22
  275. package/dist/ui/drawer.d.ts +17 -18
  276. package/dist/ui/drawer.js +7 -6
  277. package/dist/ui/dropdown-menu.d.ts +32 -33
  278. package/dist/ui/dropdown-menu.js +5 -3
  279. package/dist/ui/dropzone.d.ts +24 -24
  280. package/dist/ui/empty.d.ts +14 -14
  281. package/dist/ui/empty.js +3 -3
  282. package/dist/ui/field.d.ts +26 -27
  283. package/dist/ui/form.d.ts +4 -5
  284. package/dist/ui/gradient-editor.d.ts +16 -17
  285. package/dist/ui/hover-card.d.ts +6 -7
  286. package/dist/ui/hover-card.js +5 -3
  287. package/dist/ui/infinite-canvas.d.ts +11 -12
  288. package/dist/ui/input-group.d.ts +6 -7
  289. package/dist/ui/input-otp.d.ts +7 -8
  290. package/dist/ui/input.d.ts +3 -4
  291. package/dist/ui/item.d.ts +20 -21
  292. package/dist/ui/kbd.d.ts +7 -5
  293. package/dist/ui/kbd.js +4 -2
  294. package/dist/ui/markdown-elements.d.ts +20 -21
  295. package/dist/ui/markdown.d.ts +5 -6
  296. package/dist/ui/menubar.d.ts +25 -26
  297. package/dist/ui/menubar.js +8 -5
  298. package/dist/ui/meter.d.ts +11 -12
  299. package/dist/ui/morphing-panel.d.ts +8 -9
  300. package/dist/ui/native-select.d.ts +3 -4
  301. package/dist/ui/native-select.js +1 -1
  302. package/dist/ui/navigation-menu.d.ts +17 -18
  303. package/dist/ui/navigation-menu.js +5 -3
  304. package/dist/ui/number-field.d.ts +15 -16
  305. package/dist/ui/pagination.d.ts +10 -11
  306. package/dist/ui/phone-input.d.ts +5 -6
  307. package/dist/ui/phone-input.js +40 -37
  308. package/dist/ui/popover.d.ts +11 -12
  309. package/dist/ui/popover.js +5 -3
  310. package/dist/ui/progress.d.ts +11 -12
  311. package/dist/ui/progressive-blur.d.ts +4 -5
  312. package/dist/ui/radio-group.d.ts +5 -6
  313. package/dist/ui/resizable.d.ts +12 -13
  314. package/dist/ui/responsive-dialog.d.ts +11 -12
  315. package/dist/ui/rich-tooltip-tour.d.ts +5 -6
  316. package/dist/ui/rich-tooltip.d.ts +21 -23
  317. package/dist/ui/rich-tooltip.js +5 -5
  318. package/dist/ui/scroll-area.d.ts +7 -8
  319. package/dist/ui/scroll-area.js +9 -6
  320. package/dist/ui/select.d.ts +21 -14
  321. package/dist/ui/select.js +7 -4
  322. package/dist/ui/separator.d.ts +2 -3
  323. package/dist/ui/sheet.d.ts +8 -9
  324. package/dist/ui/sheet.js +7 -5
  325. package/dist/ui/sidebar-menu.d.ts +18 -19
  326. package/dist/ui/sidebar-menu.js +4 -3
  327. package/dist/ui/sidebar-provider.d.ts +32 -7
  328. package/dist/ui/sidebar-provider.js +82 -22
  329. package/dist/ui/sidebar-resize-rail.d.ts +8 -0
  330. package/dist/ui/sidebar-resize-rail.js +192 -0
  331. package/dist/ui/sidebar.d.ts +19 -13
  332. package/dist/ui/sidebar.js +120 -55
  333. package/dist/ui/skeleton.d.ts +7 -4
  334. package/dist/ui/skeleton.js +9 -2
  335. package/dist/ui/slider.d.ts +6 -5
  336. package/dist/ui/slider.js +16 -13
  337. package/dist/ui/spinner.d.ts +3 -4
  338. package/dist/ui/stepper.d.ts +22 -23
  339. package/dist/ui/switch.d.ts +3 -4
  340. package/dist/ui/switch.js +12 -1
  341. package/dist/ui/table-of-contents.d.ts +7 -8
  342. package/dist/ui/table-of-contents.js +4 -2
  343. package/dist/ui/table.d.ts +17 -18
  344. package/dist/ui/tabs.d.ts +14 -11
  345. package/dist/ui/textarea.d.ts +3 -4
  346. package/dist/ui/timeline.d.ts +18 -19
  347. package/dist/ui/toast.d.ts +9 -9
  348. package/dist/ui/toast.js +21 -14
  349. package/dist/ui/toggle.d.ts +5 -6
  350. package/dist/ui/toggle.js +3 -2
  351. package/dist/ui/toolbar.d.ts +15 -16
  352. package/dist/ui/toolbar.js +15 -4
  353. package/dist/ui/tooltip.d.ts +6 -13
  354. package/dist/ui/tooltip.js +7 -8
  355. package/dist/ui/tree.d.ts +18 -19
  356. package/dist/ui/tree.js +3 -2
  357. package/dist/ui/trigger-menu.d.ts +15 -16
  358. package/dist/ui/trigger-menu.js +5 -3
  359. package/dist/ui/use-switch-drag.d.ts +7 -0
  360. package/dist/ui/use-switch-drag.js +104 -0
  361. package/dist/user-ask.d.ts +24 -25
  362. package/package.json +15 -15
  363. package/dist/code-block-editor.d.ts +0 -59
  364. package/dist/code-block-editor.js +0 -250
  365. package/dist/knob-contracts/code-block-editor-knobs.d.ts +0 -5
  366. package/dist/knob-contracts/code-block-editor-knobs.js +0 -11
  367. package/dist/lib/code-block-shiki.d.ts +0 -9
  368. package/dist/lib/code-block-shiki.js +0 -6
  369. package/dist/skin.config.d.ts +0 -5
  370. package/dist/skin.config.js +0 -12
  371. package/dist/styles/recipes/code-block-editor.css +0 -136
  372. package/dist/styles/skin-theme.css +0 -137
  373. package/dist/styles/skin.css +0 -143
@@ -63,26 +63,36 @@ function ThemeSegmentedSwitch({ value, onValueChange, options = defaultThemeOpti
63
63
  const currentValue = effectiveThemeValue(value, choices);
64
64
  const activeIndex = Math.max(0, choices.findIndex((option) => option.value === currentValue));
65
65
  const indicatorStyle = {
66
- width: `calc((100% - 0.25rem) / ${choices.length})`,
66
+ width: `calc((100% - var(--_theme-switch-padding) * 2) / ${choices.length})`,
67
67
  transform: `translateX(${activeIndex * 100}%)`
68
68
  };
69
69
  return /* @__PURE__ */ jsxs("div", {
70
70
  role: "radiogroup",
71
71
  "aria-label": ariaLabel,
72
- className: classes("relative isolate inline-flex h-7 w-fit shrink-0 rounded-full border border-border bg-foreground/8 p-0.5 text-muted-foreground shadow-inner", className),
72
+ "data-control-ui": "theme-toggle",
73
+ "data-control-family": "theme-toggle",
74
+ "data-slot": "root",
75
+ className: classes("relative isolate inline-grid w-fit shrink-0 auto-cols-fr grid-flow-col [--_theme-switch-padding:calc(var(--spacing)*0.5)] [--_theme-switch-radius:min(var(--radius-control),calc(var(--control-h-xs)/2))] rounded-[calc(var(--_theme-switch-radius)+clamp(0px,var(--_theme-switch-radius)*1000,var(--_theme-switch-padding)))] border-(length:--control-rim-width) border-(--control-rim) bg-(--hover-fill) p-(--_theme-switch-padding) text-muted-foreground shadow-(--shadow-inset)", className),
73
76
  style,
74
77
  ...props,
75
78
  children: [/* @__PURE__ */ jsx("span", {
76
79
  "aria-hidden": true,
77
- className: "pointer-events-none absolute inset-y-0.5 left-0.5 rounded-full bg-background shadow-sm transition-transform duration-[var(--duration-base)] ease-[var(--ease-emphasized)]",
80
+ "data-control-ui": "theme-toggle",
81
+ "data-control-family": "theme-toggle",
82
+ "data-slot": "indicator",
83
+ className: "pointer-events-none absolute inset-y-(--_theme-switch-padding) left-(--_theme-switch-padding) rounded-(--_theme-switch-radius) bg-background shadow-(--shadow-sm) transition-transform duration-(--duration-base) ease-(--ease-standard)",
78
84
  style: indicatorStyle
79
85
  }), choices.map((option) => {
80
86
  const selected = option.value === currentValue;
81
87
  const Icon = option.icon;
82
88
  return /* @__PURE__ */ jsxs("label", {
89
+ "data-control-ui": "theme-toggle",
90
+ "data-control-family": "theme-toggle",
91
+ "data-slot": "option",
92
+ "data-control": "true",
83
93
  "data-selected": selected ? "true" : void 0,
84
94
  "data-disabled": option.disabled ? "true" : void 0,
85
- className: classes("relative z-[1] inline-flex h-6 cursor-pointer items-center justify-center gap-1.5 rounded-full px-1.5 text-xs font-medium outline-none transition-[color,scale] duration-[var(--duration-fast)] ease-[var(--ease-standard)] hover:text-foreground has-[:focus-visible]:ring-2 has-[:focus-visible]:ring-foreground/25 data-[disabled=true]:cursor-not-allowed data-[disabled=true]:opacity-45 data-[selected=true]:text-foreground active:scale-95", showLabels ? "min-w-20" : "w-7"),
95
+ className: classes("relative z-[1] inline-flex h-(--control-h-xs) cursor-pointer items-center justify-center gap-1.5 rounded-(--_theme-switch-radius) px-1.5 text-label font-medium transition-colors duration-(--duration-fast) ease-(--ease-standard) hover:text-foreground data-[disabled=true]:cursor-not-allowed data-[disabled=true]:opacity-45 data-[selected=true]:text-foreground", showLabels ? "min-w-20" : "w-(--control-h-xs)"),
86
96
  children: [
87
97
  /* @__PURE__ */ jsx("input", {
88
98
  type: "radio",
@@ -3,17 +3,17 @@ import { Button } from "./ui/button.js";
3
3
  import { ChatComposerAttachmentKnobStyle } from "./knob-contracts/chat-composer-attachment-knobs.js";
4
4
  import { CSSProperties, ComponentProps, ReactNode } from "react";
5
5
  //#region src/chat-composer-attachment.d.ts
6
- type ChatComposerAttachmentKind = "image" | "pdf" | "spreadsheet" | "document" | "archive" | "audio" | "video" | "file";
7
- type ChatComposerAttachmentStatus = "idle" | "uploading" | "uploaded" | "error";
8
- type ChatComposerAttachmentVariant = "auto" | "preview" | "file";
9
- type ChatComposerAttachmentsProps = ComponentProps<"div"> & {
6
+ export type ChatComposerAttachmentKind = "image" | "pdf" | "spreadsheet" | "document" | "archive" | "audio" | "video" | "file";
7
+ export type ChatComposerAttachmentStatus = "idle" | "uploading" | "uploaded" | "error";
8
+ export type ChatComposerAttachmentVariant = "auto" | "preview" | "file";
9
+ export type ChatComposerAttachmentsProps = ComponentProps<"div"> & {
10
10
  label?: string;
11
11
  viewportClassName?: string;
12
12
  } & {
13
13
  style?: CSSProperties & ChatComposerAttachmentKnobStyle;
14
14
  };
15
- declare function ChatComposerAttachments({ label, className, viewportClassName, children, ...props }: ChatComposerAttachmentsProps): import("react").JSX.Element;
16
- type ChatComposerAttachmentProps = Omit<ComponentProps<"li">, "style"> & {
15
+ export declare function ChatComposerAttachments({ label, className, viewportClassName, children, ...props }: ChatComposerAttachmentsProps): import("react").JSX.Element;
16
+ export type ChatComposerAttachmentProps = Omit<ComponentProps<"li">, "style"> & {
17
17
  name: string;
18
18
  type?: string;
19
19
  description?: ReactNode;
@@ -26,30 +26,29 @@ type ChatComposerAttachmentProps = Omit<ComponentProps<"li">, "style"> & {
26
26
  removeLabel?: string;
27
27
  style?: CSSProperties & ChatComposerAttachmentKnobStyle;
28
28
  };
29
- declare function ChatComposerAttachment({ name, type, description, status, progress: progressInput, previewUrl, kind, variant, onRemove, removeLabel, className, children, role, "aria-label": ariaLabel, ...props }: ChatComposerAttachmentProps): import("react").JSX.Element;
30
- type ChatComposerAttachmentPreviewProps = Omit<ComponentProps<"div">, "style"> & {
29
+ export declare function ChatComposerAttachment({ name, type, description, status, progress: progressInput, previewUrl, kind, variant, onRemove, removeLabel, className, children, role, "aria-label": ariaLabel, ...props }: ChatComposerAttachmentProps): import("react").JSX.Element;
30
+ export type ChatComposerAttachmentPreviewProps = Omit<ComponentProps<"div">, "style"> & {
31
31
  style?: CSSProperties & ChatComposerAttachmentKnobStyle;
32
32
  };
33
- declare function ChatComposerAttachmentPreview({ className, children, ...props }: ChatComposerAttachmentPreviewProps): import("react").JSX.Element;
34
- type ChatComposerAttachmentContentProps = ComponentProps<"div"> & {
33
+ export declare function ChatComposerAttachmentPreview({ className, children, ...props }: ChatComposerAttachmentPreviewProps): import("react").JSX.Element;
34
+ export type ChatComposerAttachmentContentProps = ComponentProps<"div"> & {
35
35
  style?: CSSProperties & ChatComposerAttachmentKnobStyle;
36
36
  };
37
- declare function ChatComposerAttachmentContent({ className, ...props }: ChatComposerAttachmentContentProps): import("react").JSX.Element;
38
- type ChatComposerAttachmentTitleProps = Omit<ComponentProps<"div">, "style"> & {
37
+ export declare function ChatComposerAttachmentContent({ className, ...props }: ChatComposerAttachmentContentProps): import("react").JSX.Element;
38
+ export type ChatComposerAttachmentTitleProps = Omit<ComponentProps<"div">, "style"> & {
39
39
  style?: CSSProperties & ChatComposerAttachmentKnobStyle;
40
40
  };
41
- declare function ChatComposerAttachmentTitle({ className, children, ...props }: ChatComposerAttachmentTitleProps): import("react").JSX.Element;
42
- type ChatComposerAttachmentDescriptionProps = Omit<ComponentProps<"div">, "style"> & {
41
+ export declare function ChatComposerAttachmentTitle({ className, children, ...props }: ChatComposerAttachmentTitleProps): import("react").JSX.Element;
42
+ export type ChatComposerAttachmentDescriptionProps = Omit<ComponentProps<"div">, "style"> & {
43
43
  style?: CSSProperties & ChatComposerAttachmentKnobStyle;
44
44
  };
45
- declare function ChatComposerAttachmentDescription({ className, children, ...props }: ChatComposerAttachmentDescriptionProps): import("react").JSX.Element;
46
- type ChatComposerAttachmentRemoveProps = Omit<ComponentProps<typeof Button>, "style"> & {
45
+ export declare function ChatComposerAttachmentDescription({ className, children, ...props }: ChatComposerAttachmentDescriptionProps): import("react").JSX.Element;
46
+ export type ChatComposerAttachmentRemoveProps = Omit<ComponentProps<typeof Button>, "style"> & {
47
47
  style?: CSSProperties & ButtonKnobStyle & ChatComposerAttachmentKnobStyle;
48
48
  };
49
- declare function ChatComposerAttachmentRemove({ className, onClick, children, "aria-label": ariaLabel, ...props }: ChatComposerAttachmentRemoveProps): import("react").JSX.Element | null;
50
- type ChatComposerAttachmentProgressProps = Omit<ComponentProps<"div">, "style"> & {
49
+ export declare function ChatComposerAttachmentRemove({ className, onClick, children, "aria-label": ariaLabel, ...props }: ChatComposerAttachmentRemoveProps): import("react").JSX.Element | null;
50
+ export type ChatComposerAttachmentProgressProps = Omit<ComponentProps<"div">, "style"> & {
51
51
  style?: CSSProperties & ChatComposerAttachmentKnobStyle;
52
52
  };
53
- declare function ChatComposerAttachmentProgress({ className, children, style, ...props }: ChatComposerAttachmentProgressProps): import("react").JSX.Element | null;
54
- //#endregion
55
- export { ChatComposerAttachment, ChatComposerAttachmentContent, ChatComposerAttachmentContentProps, ChatComposerAttachmentDescription, ChatComposerAttachmentDescriptionProps, ChatComposerAttachmentKind, ChatComposerAttachmentPreview, ChatComposerAttachmentPreviewProps, ChatComposerAttachmentProgress, ChatComposerAttachmentProgressProps, ChatComposerAttachmentProps, ChatComposerAttachmentRemove, ChatComposerAttachmentRemoveProps, ChatComposerAttachmentStatus, ChatComposerAttachmentTitle, ChatComposerAttachmentTitleProps, ChatComposerAttachmentVariant, ChatComposerAttachments, ChatComposerAttachmentsProps };
53
+ export declare function ChatComposerAttachmentProgress({ className, children, style, ...props }: ChatComposerAttachmentProgressProps): import("react").JSX.Element | null;
54
+ //#endregion
@@ -2,6 +2,7 @@
2
2
  import { cn } from "./lib/cn.js";
3
3
  import { Button } from "./ui/button.js";
4
4
  import { ScrollArea } from "./ui/scroll-area.js";
5
+ import { Spinner } from "./ui/spinner.js";
5
6
  import { createContext, useContext } from "react";
6
7
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
7
8
  import { XIcon } from "lucide-react";
@@ -84,9 +85,9 @@ function fallbackLabel(kind, extension) {
84
85
  }[kind];
85
86
  }
86
87
  function defaultDescription(context) {
87
- const progress = progressValue(context.progress);
88
+ const { progress } = context;
88
89
  if (context.description) return context.description;
89
- if (context.status === "uploading") return `Uploading ${Math.round(progress ?? 0)}%`;
90
+ if (context.status === "uploading") return progress === void 0 ? "Uploading…" : `Uploading ${Math.round(progress)}%`;
90
91
  if (context.status === "error") return "Upload failed";
91
92
  return fallbackLabel(context.kind, context.extension);
92
93
  }
@@ -147,7 +148,7 @@ function ChatComposerAttachment({ name, type, description, status = "idle", prog
147
148
  "data-kind": resolvedKind,
148
149
  "data-state": status,
149
150
  "data-variant": resolvedVariant,
150
- className: cn("relative shrink-0 overflow-hidden", "flex items-center", className),
151
+ className: cn("relative isolate flex shrink-0 items-center overflow-hidden", className),
151
152
  ...props,
152
153
  children: children ?? /* @__PURE__ */ jsxs(Fragment$1, { children: [
153
154
  /* @__PURE__ */ jsx(ChatComposerAttachmentPreview, {}),
@@ -161,13 +162,13 @@ function ChatComposerAttachment({ name, type, description, status = "idle", prog
161
162
  function ChatComposerAttachmentPreview({ className, children, ...props }) {
162
163
  const context = useChatComposerAttachmentContext();
163
164
  const label = fallbackLabel(context.kind, context.extension);
164
- return /* @__PURE__ */ jsxs("div", {
165
+ return /* @__PURE__ */ jsx("div", {
165
166
  "data-control-ui": "chat-composer-attachment",
166
167
  "data-control-family": "chat-composer-attachment",
167
168
  "data-slot": "preview",
168
169
  className: cn("relative grid shrink-0 place-items-center overflow-hidden", className),
169
170
  ...props,
170
- children: [children ?? (context.previewUrl ? /* @__PURE__ */ jsx("img", {
171
+ children: children ?? (context.previewUrl ? /* @__PURE__ */ jsx("img", {
171
172
  src: context.previewUrl,
172
173
  alt: context.name,
173
174
  loading: "lazy",
@@ -179,13 +180,7 @@ function ChatComposerAttachmentPreview({ className, children, ...props }) {
179
180
  "data-slot": "preview-label",
180
181
  className: "uppercase",
181
182
  children: label
182
- })), context.status === "uploading" && /* @__PURE__ */ jsx("span", {
183
- "aria-hidden": "true",
184
- "data-control-ui": "chat-composer-attachment",
185
- "data-control-family": "chat-composer-attachment",
186
- "data-slot": "status",
187
- className: "absolute right-1 top-1"
188
- })]
183
+ }))
189
184
  });
190
185
  }
191
186
  function ChatComposerAttachmentContent({ className, ...props }) {
@@ -230,6 +225,7 @@ function ChatComposerAttachmentRemove({ className, onClick, children, "aria-labe
230
225
  return /* @__PURE__ */ jsx(Button, {
231
226
  "data-control-ui": "chat-composer-attachment",
232
227
  "data-chat-composer-attachment-remove": "true",
228
+ iconOnly: true,
233
229
  "data-slot": "remove",
234
230
  "aria-label": ariaLabel ?? removeLabel ?? `Remove ${name}`,
235
231
  size: "xs",
@@ -244,23 +240,31 @@ function ChatComposerAttachmentRemove({ className, onClick, children, "aria-labe
244
240
  });
245
241
  }
246
242
  function ChatComposerAttachmentProgress({ className, children, style, ...props }) {
247
- const { status, progress } = useChatComposerAttachmentContext();
248
- if (status !== "uploading" && progress == null) return null;
243
+ const { name, status, progress } = useChatComposerAttachmentContext();
244
+ if (status !== "uploading") return null;
249
245
  return /* @__PURE__ */ jsx("div", {
250
- "aria-hidden": "true",
246
+ role: "progressbar",
247
+ "aria-label": `Uploading ${name}`,
248
+ "aria-valuemin": 0,
249
+ "aria-valuemax": 100,
250
+ "aria-valuenow": progress,
251
251
  "data-control-ui": "chat-composer-attachment",
252
252
  "data-control-family": "chat-composer-attachment",
253
253
  "data-slot": "progress",
254
- className: cn("absolute inset-x-0 bottom-0", className),
254
+ className: cn("pointer-events-none absolute inset-0 z-1 grid place-items-center", className),
255
255
  style,
256
256
  ...props,
257
- children: children ?? /* @__PURE__ */ jsx("div", {
257
+ children: children ?? /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("div", {
258
258
  "data-control-ui": "chat-composer-attachment",
259
259
  "data-control-family": "chat-composer-attachment",
260
260
  "data-slot": "progress-indicator",
261
- className: "h-full",
262
- style: { width: `${progress ?? 0}%` }
263
- })
261
+ className: "absolute inset-y-0 end-0",
262
+ style: { inlineSize: `${100 - (progress ?? 0)}%` }
263
+ }), progress === void 0 && /* @__PURE__ */ jsx(Spinner, {
264
+ "aria-hidden": "true",
265
+ className: "relative",
266
+ size: "xs"
267
+ })] })
264
268
  });
265
269
  }
266
270
  //#endregion
@@ -2,13 +2,12 @@ import { ChatComposerEditorExtension } from "../types.js";
2
2
  import { TriggerConfig, TriggerMenuItemData } from "../../hooks/use-trigger-menu.js";
3
3
  import { Command } from "prosemirror-state";
4
4
  //#region src/chat-composer-editor/extensions/mention.d.ts
5
- declare const deleteMentionBackward: Command;
6
- declare const deleteMentionForward: Command;
7
- type MentionExtensionConfig<Item extends TriggerMenuItemData = TriggerMenuItemData> = {
5
+ export declare const deleteMentionBackward: Command;
6
+ export declare const deleteMentionForward: Command;
7
+ export type MentionExtensionConfig<Item extends TriggerMenuItemData = TriggerMenuItemData> = {
8
8
  triggers: readonly TriggerConfig<Item>[];
9
9
  side?: "top" | "bottom";
10
10
  align?: "start" | "center" | "end";
11
11
  };
12
- declare function mentionExtension<Item extends TriggerMenuItemData = TriggerMenuItemData>({ triggers, side, align }: MentionExtensionConfig<Item>): ChatComposerEditorExtension;
13
- //#endregion
14
- export { MentionExtensionConfig, deleteMentionBackward, deleteMentionForward, mentionExtension };
12
+ export declare function mentionExtension<Item extends TriggerMenuItemData = TriggerMenuItemData>({ triggers, side, align }: MentionExtensionConfig<Item>): ChatComposerEditorExtension;
13
+ //#endregion
@@ -1,5 +1,4 @@
1
1
  //#region src/chat-composer-editor/ghost.d.ts
2
- declare function spawnExitGhost(source: HTMLElement, inherit?: readonly string[]): void;
3
- declare const MESSAGE_GHOST_INHERIT: readonly ["font-family", "font-size", "font-weight", "font-style", "line-height", "letter-spacing", "color", "padding", "white-space", "overflow-wrap", "word-break", "text-align"];
4
- //#endregion
5
- export { MESSAGE_GHOST_INHERIT, spawnExitGhost };
2
+ export declare function spawnExitGhost(source: HTMLElement, inherit?: readonly string[]): void;
3
+ export declare const MESSAGE_GHOST_INHERIT: readonly ["font-family", "font-size", "font-weight", "font-style", "line-height", "letter-spacing", "color", "padding", "white-space", "overflow-wrap", "word-break", "text-align"];
4
+ //#endregion
@@ -1,6 +1,5 @@
1
1
  import { ChatComposerEditorExtension } from "./types.js";
2
2
  import { Schema } from "prosemirror-model";
3
3
  //#region src/chat-composer-editor/schema.d.ts
4
- declare function createEditorSchema(extensions: readonly ChatComposerEditorExtension[]): Schema;
5
- //#endregion
6
- export { createEditorSchema };
4
+ export declare function createEditorSchema(extensions: readonly ChatComposerEditorExtension[]): Schema;
5
+ //#endregion
@@ -1,6 +1,5 @@
1
1
  import { Node, Schema } from "prosemirror-model";
2
2
  //#region src/chat-composer-editor/serialize.d.ts
3
- declare function serializeDoc(doc: Node): string;
4
- declare function docFromText(schema: Schema, text: string): Node;
5
- //#endregion
6
- export { docFromText, serializeDoc };
3
+ export declare function serializeDoc(doc: Node): string;
4
+ export declare function docFromText(schema: Schema, text: string): Node;
5
+ //#endregion
@@ -4,15 +4,15 @@ import { Command, Plugin } from "prosemirror-state";
4
4
  import { EditorView } from "prosemirror-view";
5
5
  import { Node, NodeSpec, Schema } from "prosemirror-model";
6
6
  //#region src/chat-composer-editor/types.d.ts
7
- type ChatComposerEditorApi = {
7
+ export type ChatComposerEditorApi = {
8
8
  getView: () => EditorView | null;
9
9
  subscribe: (listener: () => void) => () => void;
10
10
  registerKeyHandler: (handler: (event: KeyboardEvent) => boolean) => () => void;
11
11
  };
12
- type ChatComposerEditorOverlayProps = {
12
+ export type ChatComposerEditorOverlayProps = {
13
13
  editor: ChatComposerEditorApi;
14
14
  };
15
- type ChatComposerEditorExtension = {
15
+ export type ChatComposerEditorExtension = {
16
16
  name: string;
17
17
  nodes?: Record<string, NodeSpec>;
18
18
  plugins?: (schema: Schema, editor: ChatComposerEditorApi) => Plugin[];
@@ -20,10 +20,9 @@ type ChatComposerEditorExtension = {
20
20
  submitPayload?: (doc: Node) => Partial<ChatComposerSubmitPayload>;
21
21
  Overlay?: (props: ChatComposerEditorOverlayProps) => ReactNode;
22
22
  };
23
- type ChatComposerEditorProps = {
23
+ export type ChatComposerEditorProps = {
24
24
  className?: string;
25
25
  placeholder?: string;
26
26
  extensions?: readonly ChatComposerEditorExtension[];
27
27
  };
28
- //#endregion
29
- export { ChatComposerEditorApi, ChatComposerEditorExtension, ChatComposerEditorOverlayProps, ChatComposerEditorProps };
28
+ //#endregion
@@ -2,8 +2,7 @@ import { ChatComposerKnobStyle } from "./knob-contracts/chat-composer-knobs.js";
2
2
  import { ChatComposerEditorProps } from "./chat-composer-editor/types.js";
3
3
  import { CSSProperties } from "react";
4
4
  //#region src/chat-composer-editor.d.ts
5
- declare function ChatComposerEditor({ className, placeholder, extensions }: ChatComposerEditorProps & {
5
+ export declare function ChatComposerEditor({ className, placeholder, style, extensions }: ChatComposerEditorProps & {
6
6
  style?: CSSProperties & ChatComposerKnobStyle;
7
7
  }): import("react").JSX.Element;
8
- //#endregion
9
- export { ChatComposerEditor };
8
+ //#endregion
@@ -13,7 +13,7 @@ import { EditorState, Plugin } from "prosemirror-state";
13
13
  import { EditorView } from "prosemirror-view";
14
14
  //#region src/chat-composer-editor.tsx
15
15
  const SUBMIT_KEY = "Enter";
16
- function ChatComposerEditor({ className, placeholder, extensions = [] }) {
16
+ function ChatComposerEditor({ className, placeholder, style, extensions = [] }) {
17
17
  const input = useChatComposerContext();
18
18
  const mountRef = useRef(null);
19
19
  const viewRef = useRef(null);
@@ -78,6 +78,7 @@ function ChatComposerEditor({ className, placeholder, extensions = [] }) {
78
78
  });
79
79
  const view = new EditorView(mount, {
80
80
  state,
81
+ editable: () => !inputRef.current.isDisabled,
81
82
  attributes: {
82
83
  "aria-label": "Message",
83
84
  "aria-multiline": "true",
@@ -114,10 +115,22 @@ function ChatComposerEditor({ className, placeholder, extensions = [] }) {
114
115
  plugins: view.state.plugins
115
116
  }));
116
117
  }, [input.value]);
118
+ useEffect(() => {
119
+ viewRef.current?.setProps({
120
+ editable: () => !input.isDisabled,
121
+ attributes: {
122
+ "aria-label": "Message",
123
+ "aria-multiline": "true",
124
+ "aria-disabled": String(input.isDisabled),
125
+ role: "textbox"
126
+ }
127
+ });
128
+ }, [input.isDisabled]);
117
129
  return /* @__PURE__ */ jsxs("div", {
118
130
  "data-control-ui": "chat-composer-editor",
119
131
  "data-control-family": "chat-composer",
120
- "data-slot": "root",
132
+ "data-slot": "editor-root",
133
+ style,
121
134
  className: cn("relative", className),
122
135
  children: [
123
136
  input.value === "" && placeholder ? /* @__PURE__ */ jsx("div", {
@@ -133,7 +146,7 @@ function ChatComposerEditor({ className, placeholder, extensions = [] }) {
133
146
  "data-control-ui": "chat-composer-editor",
134
147
  "data-control-family": "chat-composer",
135
148
  "data-slot": "editor",
136
- className: cn("[&_.ProseMirror]:max-h-[40dvh] [&_.ProseMirror]:min-h-16 [&_.ProseMirror]:w-full [&_.ProseMirror]:overflow-y-auto [&_.ProseMirror]:whitespace-pre-wrap [&_.ProseMirror]:break-words [&_.ProseMirror]:px-[var(--padding-x)] [&_.ProseMirror]:py-[var(--padding-y)]", mounted ? "" : "hidden")
149
+ className: cn("[&_.ProseMirror]:max-h-[40dvh] [&_.ProseMirror]:min-h-16 [&_.ProseMirror]:w-full [&_.ProseMirror]:overflow-y-auto [&_.ProseMirror]:outline-none [&_.ProseMirror]:whitespace-pre-wrap [&_.ProseMirror]:break-words [&_.ProseMirror]:px-[var(--padding-x)] [&_.ProseMirror]:py-[var(--padding-y)]", mounted ? "" : "hidden")
137
150
  }),
138
151
  mounted ? null : /* @__PURE__ */ jsx("textarea", {
139
152
  "data-control-ui": "chat-composer-editor",
@@ -142,9 +155,10 @@ function ChatComposerEditor({ className, placeholder, extensions = [] }) {
142
155
  "aria-label": "Message",
143
156
  defaultValue: input.value,
144
157
  readOnly: true,
158
+ disabled: input.isDisabled,
145
159
  rows: 2,
146
160
  placeholder,
147
- className: "min-h-16 w-full resize-none px-[var(--padding-x)] py-[var(--padding-y)]"
161
+ className: "min-h-16 w-full resize-none outline-none px-[var(--padding-x)] py-[var(--padding-y)]"
148
162
  }),
149
163
  mounted ? initialExtensions.map((extension) => extension.Overlay ? /* @__PURE__ */ jsx(extension.Overlay, { editor: api }, extension.name) : null) : null
150
164
  ]
@@ -5,7 +5,7 @@ import { ChatDensity } from "./hooks/use-chat-message.js";
5
5
  import { ChatComposerProps, ChatComposerSubmitPayload } from "./hooks/use-chat-composer.js";
6
6
  import { CSSProperties, ComponentProps } from "react";
7
7
  //#region src/chat-composer.d.ts
8
- declare function useChatComposerContext(): {
8
+ export declare function useChatComposerContext(): {
9
9
  value: string;
10
10
  setValue: (nextValue: string) => void;
11
11
  normalizedValue: string;
@@ -29,32 +29,31 @@ declare function useChatComposerContext(): {
29
29
  preventDefault: () => void;
30
30
  }) => void;
31
31
  };
32
- declare function ChatComposer({ value, defaultValue, onValueChange, onSubmit, state, density, disabled, className, children, ...props }: ChatComposerProps): import("react").JSX.Element;
33
- type ChatComposerShellProps = Omit<ComponentProps<"div">, "style"> & {
32
+ export declare function ChatComposer({ value, defaultValue, onValueChange, onSubmit, state, density, disabled, className, children, ...props }: ChatComposerProps): import("react").JSX.Element;
33
+ export type ChatComposerShellProps = Omit<ComponentProps<"div">, "style"> & {
34
34
  style?: CSSProperties & ChatComposerKnobStyle;
35
35
  };
36
- declare function ChatComposerShell({ className, ...props }: ChatComposerShellProps): import("react").JSX.Element;
37
- type ChatComposerAccentProps = Omit<ComponentProps<"div">, "style"> & {
36
+ export declare function ChatComposerShell({ className, ...props }: ChatComposerShellProps): import("react").JSX.Element;
37
+ export type ChatComposerAccentProps = Omit<ComponentProps<"div">, "style"> & {
38
38
  style?: CSSProperties & ChatComposerKnobStyle;
39
39
  };
40
- declare function ChatComposerAccent({ className, ...props }: ChatComposerAccentProps): import("react").JSX.Element;
41
- type ChatComposerTextareaProps = Omit<ComponentProps<"textarea">, "style"> & {
40
+ export declare function ChatComposerAccent({ className, ...props }: ChatComposerAccentProps): import("react").JSX.Element;
41
+ export type ChatComposerTextareaProps = Omit<ComponentProps<"textarea">, "style"> & {
42
42
  style?: CSSProperties & ChatComposerKnobStyle;
43
43
  };
44
- declare function ChatComposerTextarea({ className, rows, disabled, onChange, onKeyDown, ...props }: ChatComposerTextareaProps): import("react").JSX.Element;
45
- type ChatComposerToolbarProps = ComponentProps<"div"> & {
44
+ export declare function ChatComposerTextarea({ className, rows, disabled, onChange, onKeyDown, ...props }: ChatComposerTextareaProps): import("react").JSX.Element;
45
+ export type ChatComposerToolbarProps = ComponentProps<"div"> & {
46
46
  style?: CSSProperties & ChatComposerKnobStyle;
47
47
  };
48
- declare function ChatComposerToolbar({ className, ...props }: ChatComposerToolbarProps): import("react").JSX.Element;
49
- type ChatComposerToolsProps = Omit<ComponentProps<"div">, "style"> & {
48
+ export declare function ChatComposerToolbar({ className, ...props }: ChatComposerToolbarProps): import("react").JSX.Element;
49
+ export type ChatComposerToolsProps = Omit<ComponentProps<"div">, "style"> & {
50
50
  style?: CSSProperties & ChatComposerKnobStyle;
51
51
  };
52
- declare function ChatComposerTools({ className, ...props }: ChatComposerToolsProps): import("react").JSX.Element;
53
- type ChatComposerFooterProps = Omit<ComponentProps<"div">, "style"> & {
52
+ export declare function ChatComposerTools({ className, ...props }: ChatComposerToolsProps): import("react").JSX.Element;
53
+ export type ChatComposerFooterProps = Omit<ComponentProps<"div">, "style"> & {
54
54
  style?: CSSProperties & ChatComposerKnobStyle;
55
55
  };
56
- declare function ChatComposerFooter({ className, ...props }: ChatComposerFooterProps): import("react").JSX.Element;
57
- type ChatComposerSubmitProps = ComponentProps<typeof Button>;
58
- declare function ChatComposerSubmit({ className, disabled, children, ...props }: ChatComposerSubmitProps): import("react").JSX.Element;
59
- //#endregion
60
- export { ChatComposer, ChatComposerAccent, ChatComposerAccentProps, ChatComposerFooter, ChatComposerFooterProps, ChatComposerShell, ChatComposerShellProps, ChatComposerSubmit, ChatComposerSubmitProps, ChatComposerTextarea, ChatComposerTextareaProps, ChatComposerToolbar, ChatComposerToolbarProps, ChatComposerTools, ChatComposerToolsProps, useChatComposerContext };
56
+ export declare function ChatComposerFooter({ className, ...props }: ChatComposerFooterProps): import("react").JSX.Element;
57
+ export type ChatComposerSubmitProps = ComponentProps<typeof Button>;
58
+ export declare function ChatComposerSubmit({ className, disabled, children, ...props }: ChatComposerSubmitProps): import("react").JSX.Element;
59
+ //#endregion
@@ -1,8 +1,10 @@
1
1
  "use client";
2
2
  import { cn } from "./lib/cn.js";
3
3
  import { hasSkinAdornment, skinAdornment } from "./skin.js";
4
+ import { useSkin } from "./skin-provider.js";
4
5
  import { Button } from "./ui/button.js";
5
6
  import { useChatComposer } from "./hooks/use-chat-composer.js";
7
+ import { useKeyboardNavigation } from "./hooks/use-keyboard-navigation.js";
6
8
  import { createContext, useContext } from "react";
7
9
  import { jsx, jsxs } from "react/jsx-runtime";
8
10
  //#region src/chat-composer.tsx
@@ -13,6 +15,7 @@ function useChatComposerContext() {
13
15
  return context;
14
16
  }
15
17
  function ChatComposer({ value, defaultValue, onValueChange, onSubmit, state = "idle", density = "comfortable", disabled = false, className, children, ...props }) {
18
+ const skin = useSkin();
16
19
  const input = useChatComposer({
17
20
  value,
18
21
  defaultValue,
@@ -21,9 +24,9 @@ function ChatComposer({ value, defaultValue, onValueChange, onSubmit, state = "i
21
24
  state,
22
25
  density,
23
26
  disabled,
24
- trackSends: hasSkinAdornment("chat-composer", "send-layer")
27
+ trackSends: hasSkinAdornment(skin, "chat-composer", "send-layer")
25
28
  });
26
- const sendLayer = skinAdornment("chat-composer", "send-layer", { sendCount: input.sendCount });
29
+ const sendLayer = skinAdornment(skin, "chat-composer", "send-layer", { sendCount: input.sendCount });
27
30
  return /* @__PURE__ */ jsx(ChatComposerContext.Provider, {
28
31
  value: input,
29
32
  children: /* @__PURE__ */ jsxs("form", {
@@ -33,7 +36,7 @@ function ChatComposer({ value, defaultValue, onValueChange, onSubmit, state = "i
33
36
  "data-state": state,
34
37
  "data-density": density,
35
38
  onSubmit: input.handleSubmit,
36
- className: cn("sticky bottom-0 w-full", className),
39
+ className: cn("relative min-w-0 w-full", className),
37
40
  ...props,
38
41
  children: [sendLayer !== void 0 && sendLayer !== null ? /* @__PURE__ */ jsx("div", {
39
42
  "aria-hidden": "true",
@@ -45,11 +48,14 @@ function ChatComposer({ value, defaultValue, onValueChange, onSubmit, state = "i
45
48
  }
46
49
  function ChatComposerShell({ className, ...props }) {
47
50
  const input = useChatComposerContext();
51
+ const keyboardNavigation = useKeyboardNavigation();
48
52
  return /* @__PURE__ */ jsx("div", {
53
+ "data-keyboard-navigation": keyboardNavigation ? "" : void 0,
49
54
  "data-control-ui": "chat-composer",
50
55
  "data-control-family": "chat-composer",
51
56
  "data-slot": "shell",
52
57
  "data-state": input.state,
58
+ "data-surface": "panel",
53
59
  className: cn("relative overflow-hidden", className),
54
60
  ...props
55
61
  });
@@ -75,17 +81,17 @@ function ChatComposerTextarea({ className, rows, disabled, onChange, onKeyDown,
75
81
  input.handleKeyDown(event);
76
82
  }
77
83
  return /* @__PURE__ */ jsx("textarea", {
78
- ...props,
79
84
  "data-control-ui": "chat-composer",
80
85
  "data-control-family": "chat-composer",
81
86
  "data-slot": "textarea",
82
87
  "aria-label": "Message",
88
+ ...props,
83
89
  value: input.value,
84
90
  onChange: handleChange,
85
91
  onKeyDown: handleKeyDown,
86
- disabled: disabled ?? input.isDisabled,
92
+ disabled: disabled || input.isDisabled,
87
93
  rows: rows ?? input.rows,
88
- className: cn("field-sizing-content min-h-16 max-h-[40dvh] w-full resize-none px-[var(--padding-x)] py-[var(--padding-y)] disabled:cursor-not-allowed", className)
94
+ className: cn("field-sizing-content min-h-16 max-h-[40dvh] w-full resize-none outline-none px-[var(--padding-x)] py-[var(--padding-y)] disabled:cursor-not-allowed", className)
89
95
  });
90
96
  }
91
97
  function ChatComposerToolbar({ className, ...props }) {
@@ -102,7 +108,7 @@ function ChatComposerTools({ className, ...props }) {
102
108
  "data-control-ui": "chat-composer",
103
109
  "data-control-family": "chat-composer",
104
110
  "data-slot": "tools",
105
- className: cn("flex min-w-0 items-center", className),
111
+ className: cn("flex min-w-0 flex-wrap items-center", className),
106
112
  ...props
107
113
  });
108
114
  }
@@ -124,7 +130,7 @@ function ChatComposerSubmit({ className, disabled, children = "Send", ...props }
124
130
  variant: "solid",
125
131
  tone: "primary",
126
132
  size: "xs",
127
- disabled: disabled ?? !input.canSubmit,
133
+ disabled: disabled || !input.canSubmit,
128
134
  className,
129
135
  ...props,
130
136
  children
@@ -1,27 +1,18 @@
1
1
  import { ChatLayoutKnobStyle } from "./knob-contracts/chat-layout-knobs.js";
2
- import { CSSProperties, ComponentProps, ElementType, ReactNode } from "react";
2
+ import { CSSProperties, ComponentProps, ReactNode } from "react";
3
3
  //#region src/chat-layout.d.ts
4
- type ChatThoughtCollapsible = {
5
- Root: ElementType;
6
- Trigger: ElementType;
7
- Content: ElementType;
8
- };
9
- type ChatLayoutProps = Omit<ComponentProps<"section">, "style"> & {
4
+ export type ChatLayoutChrome = "panel" | "embedded";
5
+ export type ChatLayoutProps = Omit<ComponentProps<"section">, "style"> & {
6
+ chrome?: ChatLayoutChrome;
10
7
  style?: CSSProperties & ChatLayoutKnobStyle;
11
8
  };
12
- declare function ChatLayout({ children, className, ...props }: ChatLayoutProps): import("react").JSX.Element;
13
- type ChatThreadProps = ComponentProps<"div">;
14
- declare function ChatThread({ children, className, ...props }: ChatThreadProps): import("react").JSX.Element;
15
- type ChatTurnProps = ComponentProps<"section"> & {
16
- from: "user" | "assistant";
9
+ export declare function ChatLayout({ children, chrome, className, ...props }: ChatLayoutProps): import("react").JSX.Element;
10
+ export type ChatThreadProps = ComponentProps<"div"> & {
11
+ composer?: ReactNode;
17
12
  };
18
- declare function ChatTurn({ from, children, className, ...props }: ChatTurnProps): import("react").JSX.Element;
19
- type ChatThoughtProps = Omit<ComponentProps<"div">, "style"> & {
20
- details?: ReactNode;
21
- defaultOpen?: boolean;
22
- collapsible?: ChatThoughtCollapsible;
23
- style?: CSSProperties & ChatLayoutKnobStyle;
13
+ export declare function ChatThread({ children, composer, className, ...props }: ChatThreadProps): import("react").JSX.Element;
14
+ export type ChatTurnProps = ComponentProps<"section"> & {
15
+ from: "user" | "assistant";
24
16
  };
25
- declare function ChatThought({ children, details, defaultOpen, collapsible, className, style, ...props }: ChatThoughtProps): import("react").JSX.Element;
26
- //#endregion
27
- export { ChatLayout, ChatLayoutProps, ChatThought, ChatThoughtProps, ChatThread, ChatThreadProps, ChatTurn, ChatTurnProps };
17
+ export declare function ChatTurn({ from, children, className, ...props }: ChatTurnProps): import("react").JSX.Element;
18
+ //#endregion