@adea-ai/ui 0.162.6 → 0.162.8

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 (364) hide show
  1. package/dist/components/composites/about-dialog/about-dialog.js +5 -5
  2. package/dist/components/composites/about-dialog/about-dialog.js.map +1 -1
  3. package/dist/components/composites/accent-picker/accent-picker.js +3 -3
  4. package/dist/components/composites/accent-picker/accent-picker.js.map +1 -1
  5. package/dist/components/composites/accent-picker/custom-color-popover.js +2 -2
  6. package/dist/components/composites/accent-picker/custom-color-popover.js.map +1 -1
  7. package/dist/components/composites/account-menu/account-menu.js +22 -22
  8. package/dist/components/composites/account-menu/account-menu.js.map +1 -1
  9. package/dist/components/composites/action-button/action-button.js +2 -2
  10. package/dist/components/composites/action-button/action-button.js.map +1 -1
  11. package/dist/components/composites/appearance-editor/accent-swatch-groups.js +3 -3
  12. package/dist/components/composites/appearance-editor/accent-swatch-groups.js.map +1 -1
  13. package/dist/components/composites/appearance-editor/appearance-choices.js +10 -10
  14. package/dist/components/composites/appearance-editor/appearance-choices.js.map +1 -1
  15. package/dist/components/composites/appearance-editor/appearance-editor.js +13 -13
  16. package/dist/components/composites/appearance-editor/appearance-editor.js.map +1 -1
  17. package/dist/components/composites/appearance-editor/appearance-rows.js +12 -12
  18. package/dist/components/composites/appearance-editor/appearance-rows.js.map +1 -1
  19. package/dist/components/composites/appearance-editor/font-settings-group.js +13 -13
  20. package/dist/components/composites/appearance-editor/font-settings-group.js.map +1 -1
  21. package/dist/components/composites/appearance-editor/theme-preview.js +1 -1
  22. package/dist/components/composites/appearance-editor/theme-preview.js.map +1 -1
  23. package/dist/components/composites/catalog-browser/catalog-browser-group.js +9 -9
  24. package/dist/components/composites/catalog-browser/catalog-browser-group.js.map +1 -1
  25. package/dist/components/composites/catalog-browser/catalog-browser.js +10 -10
  26. package/dist/components/composites/catalog-browser/catalog-browser.js.map +1 -1
  27. package/dist/components/composites/catalog-browser/catalog-detail.js +1 -1
  28. package/dist/components/composites/catalog-browser/catalog-detail.js.map +1 -1
  29. package/dist/components/composites/chain-of-thought/chain-of-thought.js +5 -5
  30. package/dist/components/composites/chain-of-thought/chain-of-thought.js.map +1 -1
  31. package/dist/components/composites/chat/chat.js +7 -7
  32. package/dist/components/composites/chat/chat.js.map +1 -1
  33. package/dist/components/composites/checkpoint/checkpoint.js +5 -5
  34. package/dist/components/composites/checkpoint/checkpoint.js.map +1 -1
  35. package/dist/components/composites/confirmation/confirmation.js +13 -13
  36. package/dist/components/composites/confirmation/confirmation.js.map +1 -1
  37. package/dist/components/composites/context/context.js +7 -7
  38. package/dist/components/composites/context/context.js.map +1 -1
  39. package/dist/components/composites/file-tree/build-file-tree.js +1 -1
  40. package/dist/components/composites/file-tree/build-file-tree.js.map +1 -1
  41. package/dist/components/composites/file-tree/file-tree.js +9 -9
  42. package/dist/components/composites/file-tree/file-tree.js.map +1 -1
  43. package/dist/components/composites/help-center/help-center.js +5 -5
  44. package/dist/components/composites/help-center/help-center.js.map +1 -1
  45. package/dist/components/composites/icon-picker/icon-picker.js +10 -10
  46. package/dist/components/composites/icon-picker/icon-picker.js.map +1 -1
  47. package/dist/components/composites/icon-picker/image-data-url.js.map +1 -1
  48. package/dist/components/composites/icon-picker/shell-icons.js +117 -117
  49. package/dist/components/composites/icon-picker/shell-icons.js.map +1 -1
  50. package/dist/components/composites/inline-citation/inline-citation.js +7 -7
  51. package/dist/components/composites/inline-citation/inline-citation.js.map +1 -1
  52. package/dist/components/composites/list-row/list-row-control.js +1 -1
  53. package/dist/components/composites/list-row/list-row-control.js.map +1 -1
  54. package/dist/components/composites/list-row/list-row.js +2 -2
  55. package/dist/components/composites/list-row/list-row.js.map +1 -1
  56. package/dist/components/composites/message-scroller/message-scroller.js +7 -7
  57. package/dist/components/composites/message-scroller/message-scroller.js.map +1 -1
  58. package/dist/components/composites/message-scroller/scroll-anchor.js +1 -1
  59. package/dist/components/composites/message-scroller/scroll-anchor.js.map +1 -1
  60. package/dist/components/composites/model-selector/model-selector.js +12 -12
  61. package/dist/components/composites/model-selector/model-selector.js.map +1 -1
  62. package/dist/components/composites/plan/plan.js +5 -5
  63. package/dist/components/composites/plan/plan.js.map +1 -1
  64. package/dist/components/composites/prompt-input/prompt-input.js +3 -3
  65. package/dist/components/composites/prompt-input/prompt-input.js.map +1 -1
  66. package/dist/components/composites/queue/queue.js +13 -13
  67. package/dist/components/composites/queue/queue.js.map +1 -1
  68. package/dist/components/composites/reasoning/reasoning.js +5 -5
  69. package/dist/components/composites/reasoning/reasoning.js.map +1 -1
  70. package/dist/components/composites/scene-controls/scene-controls.js +16 -16
  71. package/dist/components/composites/scene-controls/scene-controls.js.map +1 -1
  72. package/dist/components/composites/settings/settings-layout.js +2 -2
  73. package/dist/components/composites/settings/settings-layout.js.map +1 -1
  74. package/dist/components/composites/settings/settings-navigation.js +2 -2
  75. package/dist/components/composites/settings/settings-navigation.js.map +1 -1
  76. package/dist/components/composites/settings/settings.js +5 -5
  77. package/dist/components/composites/settings/settings.js.map +1 -1
  78. package/dist/components/composites/sources/sources.js +5 -5
  79. package/dist/components/composites/sources/sources.js.map +1 -1
  80. package/dist/components/composites/stack-trace/parse-stack-trace.js +2 -2
  81. package/dist/components/composites/stack-trace/parse-stack-trace.js.map +1 -1
  82. package/dist/components/composites/stack-trace/stack-trace.js +10 -10
  83. package/dist/components/composites/stack-trace/stack-trace.js.map +1 -1
  84. package/dist/components/composites/stat/stat.js +6 -6
  85. package/dist/components/composites/stat/stat.js.map +1 -1
  86. package/dist/components/composites/subagent/subagent.js +5 -5
  87. package/dist/components/composites/subagent/subagent.js.map +1 -1
  88. package/dist/components/composites/suggestion/suggestion.js +2 -2
  89. package/dist/components/composites/suggestion/suggestion.js.map +1 -1
  90. package/dist/components/composites/task/task.js +5 -5
  91. package/dist/components/composites/task/task.js.map +1 -1
  92. package/dist/components/composites/terminal/ansi.js +1 -1
  93. package/dist/components/composites/terminal/ansi.js.map +1 -1
  94. package/dist/components/composites/terminal/terminal.js +18 -18
  95. package/dist/components/composites/terminal/terminal.js.map +1 -1
  96. package/dist/components/composites/test-results/test-results.js +17 -17
  97. package/dist/components/composites/test-results/test-results.js.map +1 -1
  98. package/dist/components/composites/tool/tool.js +5 -5
  99. package/dist/components/composites/tool/tool.js.map +1 -1
  100. package/dist/components/composites/tree/tree.js +6 -6
  101. package/dist/components/composites/tree/tree.js.map +1 -1
  102. package/dist/components/composites/update-dialog/channel-control.js +1 -1
  103. package/dist/components/composites/update-dialog/channel-control.js.map +1 -1
  104. package/dist/components/composites/update-dialog/update-dialog.js +23 -23
  105. package/dist/components/composites/update-dialog/update-dialog.js.map +1 -1
  106. package/dist/components/composites/workspace-mark/workspace-mark.js +2 -2
  107. package/dist/components/composites/workspace-mark/workspace-mark.js.map +1 -1
  108. package/dist/components/composites/workspace-switcher/workspace-reorder-dialog.js +6 -6
  109. package/dist/components/composites/workspace-switcher/workspace-reorder-dialog.js.map +1 -1
  110. package/dist/components/composites/workspace-switcher/workspace-switcher.js +11 -11
  111. package/dist/components/composites/workspace-switcher/workspace-switcher.js.map +1 -1
  112. package/dist/components/conversation/atomic/chat-composer.js +1 -1
  113. package/dist/components/conversation/busy-send-button.js +10 -10
  114. package/dist/components/conversation/busy-send-button.js.map +1 -1
  115. package/dist/components/conversation/chat-composer.js +1 -1
  116. package/dist/components/conversation/composer-core.js +1 -1
  117. package/dist/components/conversation/composer-menu.js +2 -2
  118. package/dist/components/conversation/composer-menu.js.map +1 -1
  119. package/dist/components/conversation/conversation-avatar.js +7 -7
  120. package/dist/components/conversation/conversation-avatar.js.map +1 -1
  121. package/dist/components/conversation/conversation-pane.js +1 -1
  122. package/dist/components/conversation/conversation-pane.js.map +1 -1
  123. package/dist/components/conversation/conversation-surface.js +5 -5
  124. package/dist/components/conversation/conversation-surface.js.map +1 -1
  125. package/dist/components/conversation/internal/chat-composer-shell.js +9 -9
  126. package/dist/components/conversation/internal/chat-composer-shell.js.map +1 -1
  127. package/dist/components/conversation/message-composer.js +9 -9
  128. package/dist/components/conversation/message-composer.js.map +1 -1
  129. package/dist/components/conversation/message-row.js +13 -13
  130. package/dist/components/conversation/message-row.js.map +1 -1
  131. package/dist/components/conversation/paste-token-editor.js +1 -1
  132. package/dist/components/conversation/paste-token-editor.js.map +1 -1
  133. package/dist/components/conversation/scroll-follow.js +1 -1
  134. package/dist/components/conversation/thread-panel.js +5 -5
  135. package/dist/components/conversation/thread-panel.js.map +1 -1
  136. package/dist/components/conversation/transcript-composition.js +5 -5
  137. package/dist/components/conversation/transcript-composition.js.map +1 -1
  138. package/dist/components/layout/app-shell/app-shell.js +1 -1
  139. package/dist/components/layout/app-shell/app-shell.js.map +1 -1
  140. package/dist/components/layout/app-shell/skip-link.js +1 -1
  141. package/dist/components/layout/app-shell/skip-link.js.map +1 -1
  142. package/dist/components/layout/contextual-sidebar/contextual-sidebar.js +2 -2
  143. package/dist/components/layout/contextual-sidebar/contextual-sidebar.js.map +1 -1
  144. package/dist/components/layout/contextual-sidebar/mobile-contextual-sidebar.js +1 -1
  145. package/dist/components/layout/floating-preview/floating-preview.js +7 -7
  146. package/dist/components/layout/floating-preview/floating-preview.js.map +1 -1
  147. package/dist/components/layout/orbit-layout/orbit-layout.js +1 -1
  148. package/dist/components/layout/orbit-layout/orbit-layout.js.map +1 -1
  149. package/dist/components/layout/page/page.js +2 -2
  150. package/dist/components/layout/page/page.js.map +1 -1
  151. package/dist/components/layout/panel/panel.js +1 -1
  152. package/dist/components/layout/panel/panel.js.map +1 -1
  153. package/dist/components/layout/pixel-pane/pixel-pane.js +1 -1
  154. package/dist/components/layout/pixel-resize-handle/pixel-resize-handle.js +5 -5
  155. package/dist/components/layout/pixel-resize-handle/pixel-resize-handle.js.map +1 -1
  156. package/dist/components/layout/shell-rail/shell-rail.js +5 -5
  157. package/dist/components/layout/shell-rail/shell-rail.js.map +1 -1
  158. package/dist/components/layout/shell-top-bar/shell-top-bar.js +2 -2
  159. package/dist/components/layout/shell-top-bar/shell-top-bar.js.map +1 -1
  160. package/dist/components/layout/side-rail/side-rail.js +2 -2
  161. package/dist/components/layout/side-rail/side-rail.js.map +1 -1
  162. package/dist/components/layout/sidebar-nav/sidebar-nav-resize-handle.js +1 -1
  163. package/dist/components/layout/sidebar-nav/sidebar-nav.js +5 -5
  164. package/dist/components/layout/sidebar-nav/sidebar-nav.js.map +1 -1
  165. package/dist/components/layout/split-layout/pane-focus.js.map +1 -1
  166. package/dist/components/layout/split-layout/resize-controller-core-retry.js +1 -1
  167. package/dist/components/layout/split-layout/resize-controller-core-retry.js.map +1 -1
  168. package/dist/components/layout/split-layout/resize-controller-core.js +1 -1
  169. package/dist/components/layout/split-layout/resize-controller-core.js.map +1 -1
  170. package/dist/components/layout/split-layout/split-layout.js +7 -7
  171. package/dist/components/layout/split-layout/split-layout.js.map +1 -1
  172. package/dist/components/layout/status-bar/status-bar.js +1 -1
  173. package/dist/components/layout/status-bar/status-bar.js.map +1 -1
  174. package/dist/components/layout/top-bar/top-bar.js +5 -5
  175. package/dist/components/layout/top-bar/top-bar.js.map +1 -1
  176. package/dist/components/layout/virtual-window/virtual-window.js +1 -1
  177. package/dist/components/layout/virtual-window/virtual-window.js.map +1 -1
  178. package/dist/components/motion/presence.js +1 -1
  179. package/dist/components/theme/appearance-panel.js +3 -3
  180. package/dist/components/theme/appearance-panel.js.map +1 -1
  181. package/dist/components/theme/lazy.js +3 -3
  182. package/dist/components/theme/lazy.js.map +1 -1
  183. package/dist/components/theme/script-projection.js +1 -1
  184. package/dist/components/theme/theme-catalogue-source.js +1 -1
  185. package/dist/components/theme/theme-document.js.map +1 -1
  186. package/dist/components/theme/theme-mode-toggle.js +7 -7
  187. package/dist/components/theme/theme-mode-toggle.js.map +1 -1
  188. package/dist/components/theme/theme-picker.js +2 -2
  189. package/dist/components/theme/theme-picker.js.map +1 -1
  190. package/dist/components/theme/theme-provider-value.js +1 -1
  191. package/dist/components/theme/theme-provider-value.js.map +1 -1
  192. package/dist/components/theme/theme-provider.js +1 -1
  193. package/dist/components/theme/theme-toggle.js +7 -7
  194. package/dist/components/theme/theme-toggle.js.map +1 -1
  195. package/dist/components/ui/accordion/accordion.js +13 -13
  196. package/dist/components/ui/accordion/accordion.js.map +1 -1
  197. package/dist/components/ui/alert/alert.js +12 -12
  198. package/dist/components/ui/alert/alert.js.map +1 -1
  199. package/dist/components/ui/alert-dialog/alert-dialog.js +14 -14
  200. package/dist/components/ui/alert-dialog/alert-dialog.js.map +1 -1
  201. package/dist/components/ui/annotation-surface/annotation-surface.js +2 -2
  202. package/dist/components/ui/annotation-surface/annotation-surface.js.map +1 -1
  203. package/dist/components/ui/aspect-ratio/aspect-ratio.js +1 -1
  204. package/dist/components/ui/aspect-ratio/aspect-ratio.js.map +1 -1
  205. package/dist/components/ui/attachment/attachment.js +16 -16
  206. package/dist/components/ui/attachment/attachment.js.map +1 -1
  207. package/dist/components/ui/avatar/avatar.js +1 -1
  208. package/dist/components/ui/avatar/avatar.js.map +1 -1
  209. package/dist/components/ui/badge/badge.js +2 -2
  210. package/dist/components/ui/badge/badge.js.map +1 -1
  211. package/dist/components/ui/board/board.js +2 -2
  212. package/dist/components/ui/board/board.js.map +1 -1
  213. package/dist/components/ui/breadcrumb/breadcrumb.js +7 -7
  214. package/dist/components/ui/breadcrumb/breadcrumb.js.map +1 -1
  215. package/dist/components/ui/bubble/bubble.js +2 -2
  216. package/dist/components/ui/bubble/bubble.js.map +1 -1
  217. package/dist/components/ui/button/button.js +2 -2
  218. package/dist/components/ui/button-group/button-group.js +2 -2
  219. package/dist/components/ui/button-group/button-group.js.map +1 -1
  220. package/dist/components/ui/calendar/calendar.js +8 -8
  221. package/dist/components/ui/calendar/calendar.js.map +1 -1
  222. package/dist/components/ui/callout/callout.js +2 -2
  223. package/dist/components/ui/callout/callout.js.map +1 -1
  224. package/dist/components/ui/card/card.js +2 -2
  225. package/dist/components/ui/card/card.js.map +1 -1
  226. package/dist/components/ui/carousel/carousel.js +8 -8
  227. package/dist/components/ui/carousel/carousel.js.map +1 -1
  228. package/dist/components/ui/chart/chart.js +2 -2
  229. package/dist/components/ui/chart/chart.js.map +1 -1
  230. package/dist/components/ui/checkbox/checkbox.js +6 -6
  231. package/dist/components/ui/checkbox/checkbox.js.map +1 -1
  232. package/dist/components/ui/code-block/code-block.js +6 -6
  233. package/dist/components/ui/code-block/code-block.js.map +1 -1
  234. package/dist/components/ui/collapsible/collapsible.js +7 -7
  235. package/dist/components/ui/collapsible/collapsible.js.map +1 -1
  236. package/dist/components/ui/combobox/combobox.js +21 -21
  237. package/dist/components/ui/combobox/combobox.js.map +1 -1
  238. package/dist/components/ui/combobox/value-combobox.js +1 -1
  239. package/dist/components/ui/command/command.js +23 -23
  240. package/dist/components/ui/command/command.js.map +1 -1
  241. package/dist/components/ui/context-menu/context-menu.js +2 -2
  242. package/dist/components/ui/detail-panel/detail-panel.js +5 -5
  243. package/dist/components/ui/detail-panel/detail-panel.js.map +1 -1
  244. package/dist/components/ui/dialog/dialog-layer.js +2 -2
  245. package/dist/components/ui/dialog/dialog-layer.js.map +1 -1
  246. package/dist/components/ui/dialog/dialog.js +21 -21
  247. package/dist/components/ui/dialog/dialog.js.map +1 -1
  248. package/dist/components/ui/diff-block/diff-block.js +2 -2
  249. package/dist/components/ui/diff-block/diff-block.js.map +1 -1
  250. package/dist/components/ui/drawer/drawer.js +14 -14
  251. package/dist/components/ui/drawer/drawer.js.map +1 -1
  252. package/dist/components/ui/dropdown-menu/dropdown-menu.js +3 -3
  253. package/dist/components/ui/dropdown-menu/menu-parts.js +10 -10
  254. package/dist/components/ui/dropdown-menu/menu-parts.js.map +1 -1
  255. package/dist/components/ui/empty/empty-state.js +5 -5
  256. package/dist/components/ui/empty/empty-state.js.map +1 -1
  257. package/dist/components/ui/empty/empty.js +1 -1
  258. package/dist/components/ui/empty/empty.js.map +1 -1
  259. package/dist/components/ui/entity-icon/entity-icon.js +2 -2
  260. package/dist/components/ui/entity-icon/entity-icon.js.map +1 -1
  261. package/dist/components/ui/field/field.js +14 -14
  262. package/dist/components/ui/field/field.js.map +1 -1
  263. package/dist/components/ui/field/number-field.js +2 -2
  264. package/dist/components/ui/field/number-field.js.map +1 -1
  265. package/dist/components/ui/hover-card/hover-card.js +10 -10
  266. package/dist/components/ui/hover-card/hover-card.js.map +1 -1
  267. package/dist/components/ui/input/input-control.js +1 -1
  268. package/dist/components/ui/input/input-control.js.map +1 -1
  269. package/dist/components/ui/input/input.js +2 -2
  270. package/dist/components/ui/input/input.js.map +1 -1
  271. package/dist/components/ui/input-group/input-group.js +2 -2
  272. package/dist/components/ui/input-group/input-group.js.map +1 -1
  273. package/dist/components/ui/input-group/secret-input-group.js +2 -2
  274. package/dist/components/ui/input-otp/input-otp.js +2 -2
  275. package/dist/components/ui/input-otp/input-otp.js.map +1 -1
  276. package/dist/components/ui/item/item.js +2 -2
  277. package/dist/components/ui/item/item.js.map +1 -1
  278. package/dist/components/ui/kbd/kbd.js +2 -2
  279. package/dist/components/ui/kbd/kbd.js.map +1 -1
  280. package/dist/components/ui/label/label.js +1 -1
  281. package/dist/components/ui/label/label.js.map +1 -1
  282. package/dist/components/ui/marker/marker.js +2 -2
  283. package/dist/components/ui/marker/marker.js.map +1 -1
  284. package/dist/components/ui/menubar/menubar.js +7 -7
  285. package/dist/components/ui/menubar/menubar.js.map +1 -1
  286. package/dist/components/ui/message/message.js +3 -3
  287. package/dist/components/ui/message/message.js.map +1 -1
  288. package/dist/components/ui/modal-dialog/modal-dialog.js +2 -2
  289. package/dist/components/ui/modal-dialog/modal-dialog.js.map +1 -1
  290. package/dist/components/ui/native-select/native-select.js +5 -5
  291. package/dist/components/ui/native-select/native-select.js.map +1 -1
  292. package/dist/components/ui/navigation-menu/navigation-menu.js +18 -18
  293. package/dist/components/ui/navigation-menu/navigation-menu.js.map +1 -1
  294. package/dist/components/ui/pagination/pagination.js +28 -28
  295. package/dist/components/ui/pagination/pagination.js.map +1 -1
  296. package/dist/components/ui/popover/popover.js +15 -15
  297. package/dist/components/ui/popover/popover.js.map +1 -1
  298. package/dist/components/ui/progress/progress.js +5 -5
  299. package/dist/components/ui/progress/progress.js.map +1 -1
  300. package/dist/components/ui/questionnaire/questionnaire.js +10 -10
  301. package/dist/components/ui/questionnaire/questionnaire.js.map +1 -1
  302. package/dist/components/ui/radio-group/radio-group.js +9 -9
  303. package/dist/components/ui/radio-group/radio-group.js.map +1 -1
  304. package/dist/components/ui/resizable/resizable.js +11 -11
  305. package/dist/components/ui/resizable/resizable.js.map +1 -1
  306. package/dist/components/ui/scroll-area/scroll-area.js +1 -1
  307. package/dist/components/ui/scroll-area/scroll-area.js.map +1 -1
  308. package/dist/components/ui/select/select.js +21 -21
  309. package/dist/components/ui/select/select.js.map +1 -1
  310. package/dist/components/ui/separator/separator.js +5 -5
  311. package/dist/components/ui/separator/separator.js.map +1 -1
  312. package/dist/components/ui/sheet/sheet.js +6 -6
  313. package/dist/components/ui/sheet/sheet.js.map +1 -1
  314. package/dist/components/ui/skeleton/skeleton.js +1 -1
  315. package/dist/components/ui/skeleton/skeleton.js.map +1 -1
  316. package/dist/components/ui/slider/slider.js +5 -5
  317. package/dist/components/ui/slider/slider.js.map +1 -1
  318. package/dist/components/ui/spinner/spinner.js +5 -5
  319. package/dist/components/ui/spinner/spinner.js.map +1 -1
  320. package/dist/components/ui/status-chip/status-chip.js +2 -2
  321. package/dist/components/ui/status-chip/status-chip.js.map +1 -1
  322. package/dist/components/ui/switch/switch.js +4 -4
  323. package/dist/components/ui/switch/switch.js.map +1 -1
  324. package/dist/components/ui/table/table.js +1 -1
  325. package/dist/components/ui/table/table.js.map +1 -1
  326. package/dist/components/ui/tabs/tabs.js +7 -7
  327. package/dist/components/ui/tabs/tabs.js.map +1 -1
  328. package/dist/components/ui/text-link/text-link.js +1 -1
  329. package/dist/components/ui/text-link/text-link.js.map +1 -1
  330. package/dist/components/ui/textarea/textarea.js +2 -2
  331. package/dist/components/ui/textarea/textarea.js.map +1 -1
  332. package/dist/components/ui/toast/toast.js +7 -7
  333. package/dist/components/ui/toast/toast.js.map +1 -1
  334. package/dist/components/ui/toggle/toggle.js +6 -6
  335. package/dist/components/ui/toggle/toggle.js.map +1 -1
  336. package/dist/components/ui/toggle-group/toggle-group.js +7 -8
  337. package/dist/components/ui/toggle-group/toggle-group.js.map +1 -1
  338. package/dist/components/ui/tooltip/deferred-tooltip.js +6 -6
  339. package/dist/components/ui/tooltip/deferred-tooltip.js.map +1 -1
  340. package/dist/components/ui/tooltip/lazy-tooltip.js +2 -2
  341. package/dist/components/ui/tooltip/tooltip.js +10 -10
  342. package/dist/components/ui/tooltip/tooltip.js.map +1 -1
  343. package/dist/components/ui/trace/trace.js +19 -19
  344. package/dist/components/ui/trace/trace.js.map +1 -1
  345. package/dist/components/ui/typography/typography.js +2 -2
  346. package/dist/lib/accent-presets.js +1 -1
  347. package/dist/lib/accent-roles.js +2 -2
  348. package/dist/lib/async-action.js +1 -1
  349. package/dist/lib/create-poll.js +1 -1
  350. package/dist/lib/create-poll.js.map +1 -1
  351. package/dist/lib/external-link.js +1 -1
  352. package/dist/lib/external-link.js.map +1 -1
  353. package/dist/lib/fast-icon.js +1 -1
  354. package/dist/lib/theme-css.js +1 -1
  355. package/dist/lib/theme-engine-light.js +1 -1
  356. package/dist/lib/theme-projection.js +2 -2
  357. package/dist/lib/theme-records.js +1 -1
  358. package/dist/lib/themes.js +1 -1
  359. package/dist/lib/themes.js.map +1 -1
  360. package/dist/lib/tooltip-focus-gate.js.map +1 -1
  361. package/dist/lib/utils.js +1 -1
  362. package/dist/vite/source-parser.js +1 -1
  363. package/dist/vite/tailwind-sources.js +1 -1
  364. package/package.json +7 -7
@@ -1 +1 @@
1
- {"version":3,"file":"code-block.js","names":["<div class=\"flex items-center gap-1 opacity-0 transition-opacity group-focus-within/code:opacity-100 group-hover/code:opacity-100 [@media(hover:none)]:opacity-100\">\n {local.actions}\n <ActionButton\n variant=\"ghost\"\n size=\"icon-2xs\"\n touchTarget=\"comfortable\"\n aria-label={copied() ? (local.copiedLabel ?? 'Copied') : (local.copyLabel ?? 'Copy code')}\n tooltip={local.copyLabel ?? 'Copy code'}\n title={failed() ? 'Copying is unavailable in this context' : undefined}\n onClick={() => void copy()}\n >\n <Show when={copied()} fallback={<Copy aria-hidden=\"true\" />}>\n <Check aria-hidden=\"true\" />\n </Show>\n </ActionButton>\n </div>","<ActionButton\n variant=\"ghost\"\n size=\"icon-2xs\"\n touchTarget=\"comfortable\"\n aria-label={copied() ? (local.copiedLabel ?? 'Copied') : (local.copyLabel ?? 'Copy code')}\n tooltip={local.copyLabel ?? 'Copy code'}\n title={failed() ? 'Copying is unavailable in this context' : undefined}\n onClick={() => void copy()}\n >\n <Show when={copied()} fallback={<Copy aria-hidden=\"true\" />}>\n <Check aria-hidden=\"true\" />\n </Show>\n </ActionButton>","variant=\"ghost\"","size=\"icon-2xs\"","touchTarget=\"comfortable\"","copied() ? (local.copiedLabel ?? 'Copied') : (local.copyLabel ?? 'Copy code')","onClick={() => void copy()}","<Show when={copied()} fallback={<Copy aria-hidden=\"true\" />}>\n <Check aria-hidden=\"true\" />\n </Show>","<Check aria-hidden=\"true\" />","<Copy aria-hidden=\"true\" />","ref={(element: HTMLDivElement) => {\n root = element\n // Composed rather than replaced: a caller's ref must survive.\n forwardRef(() => local.ref, element)\n }}","<Actions />","ref={(element: HTMLDivElement) => (bodyElement = element)}","<Show\n when={highlighter()}\n fallback={\n <pre\n class={cn('m-0', small() ? 'px-2 py-1.5' : 'px-3 py-2')}\n style={{ 'line-height': local.lineHeight ?? '1.5' }}\n >\n <code class=\"font-code text-code\">\n <Show when={perLine()} fallback={local.code.replace(/\\n$/, '')}>\n <For each={visibleLines()}>\n {(line, index) => (\n <CodeLine\n line={line}\n number={index() + 1}\n numbered={local.showLineNumbers === true}\n mark={local.lineMarks?.[index() + 1]}\n wrap={local.wrap === true}\n />\n )}\n </For>\n </Show>\n </code>\n </pre>\n }\n >\n {(highlight) => (\n <div class={small() ? 'px-2 py-1.5' : 'px-3 py-2'}>\n {highlight()(hiddenLines() > 0 ? visibleLines().join('\\n') : local.code)}\n </div>\n )}\n </Show>","<For each={visibleLines()}>\n {(line, index) => (\n <CodeLine\n line={line}\n number={index() + 1}\n numbered={local.showLineNumbers === true}\n mark={local.lineMarks?.[index() + 1]}\n wrap={local.wrap === true}\n />\n )}\n </For>","<CodeLine\n line={line}\n number={index() + 1}\n numbered={local.showLineNumbers === true}\n mark={local.lineMarks?.[index() + 1]}\n wrap={local.wrap === true}\n />","'line-height': local.lineHeight ?? '1.5'","<pre\n class={cn('m-0', small() ? 'px-2 py-1.5' : 'px-3 py-2')}\n style={{ 'line-height': local.lineHeight ?? '1.5' }}\n >\n <code class=\"font-code text-code\">\n <Show when={perLine()} fallback={local.code.replace(/\\n$/, '')}>\n <For each={visibleLines()}>\n {(line, index) => (\n <CodeLine\n line={line}\n number={index() + 1}\n numbered={local.showLineNumbers === true}\n mark={local.lineMarks?.[index() + 1]}\n wrap={local.wrap === true}\n />\n )}\n </For>\n </Show>\n </code>\n </pre>","<div\n ref={(element: HTMLDivElement) => (bodyElement = element)}\n data-slot=\"code-block-body\"\n data-wrap={local.wrap ? '' : undefined}\n class={cn('scroll-fade overflow-x-auto', {\n // A capped body scrolls on both axes; the region is already a tab stop,\n // so the keyboard reaches the vertical overflow the same way.\n 'overflow-y-auto': local.maxHeight !== undefined,\n '[&_pre]:whitespace-pre-wrap [&_pre]:[overflow-wrap:anywhere]': local.wrap,\n })}\n style={maxHeight() === undefined ? undefined : { 'max-height': maxHeight() }}\n // A region that scrolls must be focusable, and a tab stop needs a name.\n // A `group`, not a `region`: a landmark with the same role and name as the\n // next block's (\"ts code\" twice) is a duplicate in the screen reader's\n // landmark list, and a long answer would fill that list with code blocks.\n tabindex=\"0\"\n role=\"group\"\n aria-label={groupLabel()}\n >\n <Show\n when={highlighter()}\n fallback={\n <pre\n class={cn('m-0', small() ? 'px-2 py-1.5' : 'px-3 py-2')}\n style={{ 'line-height': local.lineHeight ?? '1.5' }}\n >\n <code class=\"font-code text-code\">\n <Show when={perLine()} fallback={local.code.replace(/\\n$/, '')}>\n <For each={visibleLines()}>\n {(line, index) => (\n <CodeLine\n line={line}\n number={index() + 1}\n numbered={local.showLineNumbers === true}\n mark={local.lineMarks?.[index() + 1]}\n wrap={local.wrap === true}\n />\n )}\n </For>\n </Show>\n </code>\n </pre>\n }\n >\n {(highlight) => (\n <div class={small() ? 'px-2 py-1.5' : 'px-3 py-2'}>\n {highlight()(hiddenLines() > 0 ? visibleLines().join('\\n') : local.code)}\n </div>\n )}\n </Show>\n <Show when={truncated()}>\n <div class=\"flex items-center gap-2 border-t border-border px-3 py-1 text-xs text-muted-foreground\">\n <span>\n Showing the first {visibleLines().length.toLocaleString()} of{' '}\n {lines().length.toLocaleString()} lines.\n </span>\n <Button\n variant=\"ghost\"\n size=\"2xs\"\n onClick={() => {\n setShowAll(true)\n // This button leaves the document with the click; the scroller\n // is the nearest place focus can stay, so a keyboard user keeps their place.\n bodyElement?.focus({ preventScroll: true })\n }}\n >\n Show all {lines().length.toLocaleString()} lines\n </Button>\n </div>\n </Show>\n {/*\n In the scroller's box, and a single line: the indicator must not add\n height when it disappears, or a streaming block shifts everything below\n it as it resolves.\n */}\n <Show when={!local.complete}>\n <p class=\"px-3 pb-2 text-xs text-muted-foreground italic\">Generating…</p>\n </Show>\n </div>","<span>\n Showing the first {visibleLines().length.toLocaleString()} of{' '}\n {lines().length.toLocaleString()} lines.\n </span>","<Button\n variant=\"ghost\"\n size=\"2xs\"\n onClick={() => {\n setShowAll(true)\n // This button leaves the document with the click; the scroller\n // is the nearest place focus can stay, so a keyboard user keeps their place.\n bodyElement?.focus({ preventScroll: true })\n }}\n >\n Show all {lines().length.toLocaleString()} lines\n </Button>","size=\"2xs\"","onClick={() => {\n setShowAll(true)\n // This button leaves the document with the click; the scroller\n // is the nearest place focus can stay, so a keyboard user keeps their place.\n bodyElement?.focus({ preventScroll: true })\n }}","lines().length.toLocaleString()","<p class=\"px-3 pb-2 text-xs text-muted-foreground italic\">Generating…</p>","data-wrap={local.wrap ? '' : undefined}","class={cn('scroll-fade overflow-x-auto', {\n // A capped body scrolls on both axes; the region is already a tab stop,\n // so the keyboard reaches the vertical overflow the same way.\n 'overflow-y-auto': local.maxHeight !== undefined,\n '[&_pre]:whitespace-pre-wrap [&_pre]:[overflow-wrap:anywhere]': local.wrap,\n })}","style={maxHeight() === undefined ? undefined : { 'max-height': maxHeight() }}","aria-label={groupLabel()}","<div\n data-slot=\"code-block\"\n data-size={local.size ?? 'default'}\n class={cn(\n 'group/code overflow-hidden border border-border bg-card',\n small() ? 'rounded-lg' : 'rounded-xl',\n local.class\n )}\n {...rest}\n ref={(element: HTMLDivElement) => {\n root = element\n // Composed rather than replaced: a caller's ref must survive.\n forwardRef(() => local.ref, element)\n }}\n >\n <div\n class={cn('flex items-center justify-between gap-2', small() ? 'px-2 py-0.5' : 'px-3 py-1')}\n >\n <span class=\"truncate font-code text-code text-muted-foreground\">{label()}</span>\n <Actions />\n </div>\n <div\n ref={(element: HTMLDivElement) => (bodyElement = element)}\n data-slot=\"code-block-body\"\n data-wrap={local.wrap ? '' : undefined}\n class={cn('scroll-fade overflow-x-auto', {\n // A capped body scrolls on both axes; the region is already a tab stop,\n // so the keyboard reaches the vertical overflow the same way.\n 'overflow-y-auto': local.maxHeight !== undefined,\n '[&_pre]:whitespace-pre-wrap [&_pre]:[overflow-wrap:anywhere]': local.wrap,\n })}\n style={maxHeight() === undefined ? undefined : { 'max-height': maxHeight() }}\n // A region that scrolls must be focusable, and a tab stop needs a name.\n // A `group`, not a `region`: a landmark with the same role and name as the\n // next block's (\"ts code\" twice) is a duplicate in the screen reader's\n // landmark list, and a long answer would fill that list with code blocks.\n tabindex=\"0\"\n role=\"group\"\n aria-label={groupLabel()}\n >\n <Show\n when={highlighter()}\n fallback={\n <pre\n class={cn('m-0', small() ? 'px-2 py-1.5' : 'px-3 py-2')}\n style={{ 'line-height': local.lineHeight ?? '1.5' }}\n >\n <code class=\"font-code text-code\">\n <Show when={perLine()} fallback={local.code.replace(/\\n$/, '')}>\n <For each={visibleLines()}>\n {(line, index) => (\n <CodeLine\n line={line}\n number={index() + 1}\n numbered={local.showLineNumbers === true}\n mark={local.lineMarks?.[index() + 1]}\n wrap={local.wrap === true}\n />\n )}\n </For>\n </Show>\n </code>\n </pre>\n }\n >\n {(highlight) => (\n <div class={small() ? 'px-2 py-1.5' : 'px-3 py-2'}>\n {highlight()(hiddenLines() > 0 ? visibleLines().join('\\n') : local.code)}\n </div>\n )}\n </Show>\n <Show when={truncated()}>\n <div class=\"flex items-center gap-2 border-t border-border px-3 py-1 text-xs text-muted-foreground\">\n <span>\n Showing the first {visibleLines().length.toLocaleString()} of{' '}\n {lines().length.toLocaleString()} lines.\n </span>\n <Button\n variant=\"ghost\"\n size=\"2xs\"\n onClick={() => {\n setShowAll(true)\n // This button leaves the document with the click; the scroller\n // is the nearest place focus can stay, so a keyboard user keeps their place.\n bodyElement?.focus({ preventScroll: true })\n }}\n >\n Show all {lines().length.toLocaleString()} lines\n </Button>\n </div>\n </Show>\n {/*\n In the scroller's box, and a single line: the indicator must not add\n height when it disappears, or a streaming block shifts everything below\n it as it resolves.\n */}\n <Show when={!local.complete}>\n <p class=\"px-3 pb-2 text-xs text-muted-foreground italic\">Generating…</p>\n </Show>\n </div>\n <Show when={tall()}>\n <div\n data-code-block-footer=\"\"\n class=\"flex items-center justify-end border-t border-transparent px-3 py-1 transition-colors group-focus-within/code:border-border group-hover/code:border-border\"\n >\n <Actions />\n </div>\n </Show>\n </div>","<Show when={props.numbered}>\n <span class=\"text-right text-muted-foreground select-none\" aria-hidden=\"true\">\n {props.number}\n </span>\n </Show>","<Show\n when={props.mark === 'add' || props.mark === 'remove'}\n fallback={\n <span data-mark={props.mark} class={rowClass()}>\n {content()}\n </span>\n }\n >\n <Show\n when={props.mark === 'add'}\n fallback={\n <del data-mark=\"remove\" class={rowClass()}>\n {content()}\n </del>\n }\n >\n <ins data-mark=\"add\" class={rowClass()}>\n {content()}\n </ins>\n </Show>\n </Show>","<Show\n when={props.mark === 'add'}\n fallback={\n <del data-mark=\"remove\" class={rowClass()}>\n {content()}\n </del>\n }\n >\n <ins data-mark=\"add\" class={rowClass()}>\n {content()}\n </ins>\n </Show>","class={rowClass()}","<code\n class={cn(\n 'rounded-sm bg-muted px-[0.4em] py-[0.15em] font-code text-code text-foreground [overflow-wrap:anywhere]',\n local.class\n )}\n {...rest}\n />","Check","LucideCheck","Copy","LucideCopy","_$readShallow","_$setStyleProperty","_$setAttribute"],"sources":["../../../../src/components/ui/code-block/code-block.tsx"],"sourcesContent":["import { createEffect, createMemo, createSignal, For, onSettled, Show, omit } from 'solid-js'\nimport { type ComponentProps, type JSX } from '@solidjs/web'\nimport { Check as LucideCheck, Copy as LucideCopy } from '@lucide/solid'\nimport { createCopyFeedback } from '#lib/clipboard'\nimport { observeResize } from '#lib/observe-resize'\nimport { cn } from '#lib/utils'\nimport { ActionButton } from '../../composites/action-button'\nimport { Button } from '../button'\nimport { fastIcon } from '#lib/fast-icon'\nimport { forwardRef } from '#lib/refs'\n\n// lucide icons drawn from a cloned template (see fastIcon).\nconst Check = fastIcon(LucideCheck)\nconst Copy = fastIcon(LucideCopy)\n\n/**\n * CodeBlock.\n *\n * A fenced block, rendered as a surface. The library ships no highlighter —\n * syntax colouring is a large dependency with its own theme format, and a\n * component that bundled one would force every consumer to pay for it. This\n * renders the block, its chrome, and its behaviour; a caller that wants\n * highlighting passes the result through `highlight`, which is the seam a\n * Shiki/Pierre/Prism integration plugs into.\n *\n * Four details are the reason this exists rather than a styled `<pre>`:\n *\n * **Copy confirms only on success.** `navigator.clipboard.writeText` rejects\n * outside a secure context, in a sandboxed frame, and when the document is not\n * focused. Flipping to a tick unconditionally confirms a copy that did not\n * happen, and the reader pastes something stale and does not know why. The\n * rejection is caught and the button reports the failure instead.\n *\n * **A tall block repeats its action row at the bottom.** Copying from a block\n * that is taller than the viewport otherwise costs a scroll back to the top and\n * another scroll down to where you were. The threshold is a fixed 480px rather\n * than viewport-relative so the behaviour does not change when the window is\n * resized.\n *\n * **The scroller is focusable and named.** A horizontally scrollable region has\n * to be reachable by keyboard — this is axe's `scrollable-region-focusable`, and\n * a region that scrolls but cannot be focused is a WCAG 2.1.1 failure. It is a\n * labelled `group` rather than a bare `tabindex`, so the tab stop announces what\n * it is. It is deliberately not a `region` landmark: a transcript holds many\n * blocks, often in one language, and repeated landmarks of one name are noise.\n *\n * **Resolving a streaming block must not move the reader.** When `complete` is\n * false the block shows the code it has plus a generating indicator; the\n * indicator is inside the scroller's own box and does not add a line, because a\n * block that grows the moment its content resolves shifts everything below it.\n * If a caller's `highlight` changes the line box, that is the caller's height to\n * hold — `lineHeight` is a prop for exactly that reason.\n *\n * ## Output, not only source\n *\n * The same surface carries terminal output, logs and diffs inside an agent's\n * activity, so it also:\n *\n * - **loads its highlighter lazily** (`loadHighlight`). The grammar is fetched\n * only for a block that is complete and has a language, the block renders plain\n * until it arrives, and a loader that returns nothing — an unknown language, a\n * failed fetch — leaves the plain text in place without an error. Highlighting\n * a block on every streamed delta would re-tokenise the whole thing per token,\n * so a streaming block stays plain until `complete`.\n * - **marks lines** (`lineMarks`) as added, removed, highlighted or failed. A mark\n * is carried by a gutter glyph and by `<ins>`/`<del>` for the two that change\n * text, never by colour alone, and the glyph is not selectable so a copied\n * selection stays the source.\n * - **copies the source exactly.** The copy button writes `code` as given: no\n * trailing-newline trimming, no line numbers, no gutter glyphs, and the whole\n * block even when only part of it is rendered (`lineLimit`).\n * - **bounds a large render.** Past `lineLimit` lines the per-line renderer and a\n * highlighted render show the first lines and a control to show the rest,\n * because tens of thousands of row elements, or a tokenizer run over all of\n * them, are a freeze, not a transcript. Which renderer is in use is decided\n * at the time, so a highlighter that loads late takes over the bound from the\n * per-line rows and the note below the block always describes what is drawn.\n * The plain renderer is a single text node and needs no limit.\n * - **comes in a small size** (`size=\"sm\"`) for tool output inside a Trace line.\n */\nexport type CodeBlockProps = Omit<ComponentProps<'div'>, 'children' | 'onCopy'> & {\n code: string\n /** The language, shown in the header and used as the region's label. */\n language?: string\n /** The code, transformed — highlighted HTML or a component. Omit for plain text. */\n highlight?: (code: string) => JSX.Element\n /** False while the block is still streaming. Adds a generating indicator. */\n complete?: boolean\n /** A filename or title, shown instead of the language. */\n title?: string\n /** Extra header controls, before the copy button. */\n actions?: JSX.Element\n /** Copy label. Override for a non-English application. */\n copyLabel?: string\n copiedLabel?: string\n /** Line height of the rendered code. Set it when `highlight` changes the box. */\n lineHeight?: string\n /** A line-number gutter. Off by default; a short snippet rarely needs one. */\n showLineNumbers?: boolean\n /** The height above which the action row is repeated below the block. */\n tallThreshold?: number\n /**\n * Cap the code body's height and scroll it vertically past that. A number is\n * pixels; a string is any CSS length (`'20rem'`, `'50vh'`). Unset, the block\n * grows with its content.\n */\n maxHeight?: number | string\n /**\n * Soft-wrap long lines inside the block instead of scrolling sideways. Off by\n * default: wrapped code loses its column alignment, so it is for prose-like\n * output (logs, long commands) in a narrow column. Wraps the plain renderer and\n * any `pre` inside `highlight` output; line numbers stay on the first visual line.\n */\n wrap?: boolean\n /** `sm` is the compact chrome for output nested inside a Trace line. */\n size?: 'default' | 'sm'\n /**\n * Marks on 1-based line numbers. Applies to the per-line renderer, which is\n * used whenever marks or line numbers are present and no highlighter is in use,\n * given as `highlight` or loaded by `loadHighlight`: a highlighter replaces the\n * rows, so the marks and the gutter go with them.\n */\n lineMarks?: Readonly<Record<number, CodeLineMark>>\n /**\n * Resolve a highlighter for the block's language. Called once the block is\n * complete; resolving to `undefined` (or rejecting) keeps the plain rendering.\n */\n loadHighlight?: (language: string | undefined) => Promise<CodeHighlighter | undefined>\n /**\n * Lines the per-line and the highlighted renderer show before offering the\n * rest. Default 2000. The plain renderer is one text node and is not limited.\n */\n lineLimit?: number\n /** Called after each copy attempt with whether the clipboard accepted it. */\n onCopy?: (ok: boolean) => void\n}\n\nexport type CodeLineMark = 'add' | 'remove' | 'highlight' | 'error'\nexport type CodeHighlighter = (code: string) => JSX.Element\n\nexport const CODE_BLOCK_LINE_LIMIT = 2_000\n\nexport const TALL_CODE_BLOCK_PX = 480\n\nconst NO_LINES: readonly string[] = []\n\nexport function CodeBlock(props: CodeBlockProps) {\n const local = props\n const rest = omit(\n props,\n 'code',\n 'language',\n 'highlight',\n 'complete',\n 'title',\n 'actions',\n 'copyLabel',\n 'copiedLabel',\n 'lineHeight',\n 'showLineNumbers',\n 'tallThreshold',\n 'maxHeight',\n 'wrap',\n 'size',\n 'lineMarks',\n 'loadHighlight',\n 'lineLimit',\n 'onCopy',\n 'class',\n 'ref'\n )\n\n const { copied, failed, copy: copyText } = createCopyFeedback()\n const [tall, setTall] = createSignal(false)\n\n const [loaded, setLoaded] = createSignal<CodeHighlighter>()\n const [showAll, setShowAll] = createSignal(false)\n let bodyElement: HTMLDivElement | undefined\n let root: HTMLDivElement | undefined\n\n // A language string can come from untrusted model output. It is rendered as\n // text, so it cannot inject markup; the cap keeps a pathological one from\n // swallowing the header.\n const language = () => local.language?.trim().slice(0, 40) || undefined\n const label = () => local.title ?? language() ?? 'code'\n const groupLabel = () => (language() ? `${language()} code` : 'code')\n const small = () => local.size === 'sm'\n const highlighter = (): CodeHighlighter | undefined => local.highlight ?? loaded()\n const perLine = () =>\n highlighter() === undefined && (local.showLineNumbers === true || local.lineMarks !== undefined)\n const usesLines = () => highlighter() !== undefined || perLine()\n // Memos run eagerly, so the split is gated on a renderer that reads lines: a\n // streaming plain block would otherwise split its whole text on every delta.\n const lines = createMemo((): readonly string[] =>\n usesLines() ? local.code.replace(/\\n$/, '').split('\\n') : NO_LINES\n )\n const lineLimit = () => local.lineLimit ?? CODE_BLOCK_LINE_LIMIT\n const visibleLines = createMemo(() => (showAll() ? lines() : lines().slice(0, lineLimit())))\n const hiddenLines = () => lines().length - visibleLines().length\n\n // Load once the block has stopped changing. The compute keys the effect to the\n // language and completion, not to every streamed character, and a stale\n // resolution (the language changed while the grammar was in flight) is dropped.\n createEffect(\n () => ({\n complete: local.complete,\n lang: language(),\n load: local.loadHighlight,\n own: local.highlight !== undefined,\n }),\n ({ complete, lang, load, own }) => {\n setLoaded(undefined)\n if (!complete || !load || own) return\n let current = true\n // Wrapped, not called bare: a loader that throws before it returns a promise\n // (a bad import path, a missing grammar table) must degrade to plain text\n // like one that rejects, not tear down the tree from inside this effect.\n new Promise<CodeHighlighter | undefined>((resolve) => resolve(load(lang))).then(\n (resolved) => {\n if (current && resolved) setLoaded(() => resolved)\n },\n () => undefined\n )\n return () => {\n current = false\n }\n }\n )\n // The renderer in use decides everything about the limit, not the props alone:\n // a highlighter that has loaded since the first render replaces the per-line\n // rows, so what is drawn, and what the footer may say, follows `highlighter()`.\n const truncated = () => usesLines() && hiddenLines() > 0\n const maxHeight = () =>\n typeof local.maxHeight === 'number' ? `${local.maxHeight}px` : local.maxHeight\n\n // Measured rather than assumed: the caller controls the content, so only\n // the rendered box can say whether the action row has scrolled away.\n // The body is what is watched, not the block: the repeated action row is\n // added to the block, so watching the block made this callback resize the\n // very element it observes, which is a ResizeObserver loop (WebKit reports\n // it as an uncaught \"loop completed with undelivered notifications\" error).\n // The footer's own height is left out of the measure for the same reason: a\n // block is tall by its content, not by the row that tallness adds.\n // One observer is shared by every block (see observeResize).\n onSettled(() => {\n const block = root\n if (!block || !bodyElement) return\n const measure = () => {\n const footer = block.querySelector<HTMLElement>('[data-code-block-footer]')\n setTall(\n block.offsetHeight - (footer?.offsetHeight ?? 0) >\n (local.tallThreshold ?? TALL_CODE_BLOCK_PX)\n )\n }\n return observeResize(bodyElement, measure)\n })\n\n const copy = async () => {\n const ok = await copyText(local.code)\n local.onCopy?.(ok)\n }\n\n const Actions = () => (\n <div class=\"flex items-center gap-1 opacity-0 transition-opacity group-focus-within/code:opacity-100 group-hover/code:opacity-100 [@media(hover:none)]:opacity-100\">\n {local.actions}\n <ActionButton\n variant=\"ghost\"\n size=\"icon-2xs\"\n touchTarget=\"comfortable\"\n aria-label={copied() ? (local.copiedLabel ?? 'Copied') : (local.copyLabel ?? 'Copy code')}\n tooltip={local.copyLabel ?? 'Copy code'}\n title={failed() ? 'Copying is unavailable in this context' : undefined}\n onClick={() => void copy()}\n >\n <Show when={copied()} fallback={<Copy aria-hidden=\"true\" />}>\n <Check aria-hidden=\"true\" />\n </Show>\n </ActionButton>\n </div>\n )\n\n return (\n <div\n data-slot=\"code-block\"\n data-size={local.size ?? 'default'}\n class={cn(\n 'group/code overflow-hidden border border-border bg-card',\n small() ? 'rounded-lg' : 'rounded-xl',\n local.class\n )}\n {...rest}\n ref={(element: HTMLDivElement) => {\n root = element\n // Composed rather than replaced: a caller's ref must survive.\n forwardRef(() => local.ref, element)\n }}\n >\n <div\n class={cn('flex items-center justify-between gap-2', small() ? 'px-2 py-0.5' : 'px-3 py-1')}\n >\n <span class=\"truncate font-code text-code text-muted-foreground\">{label()}</span>\n <Actions />\n </div>\n <div\n ref={(element: HTMLDivElement) => (bodyElement = element)}\n data-slot=\"code-block-body\"\n data-wrap={local.wrap ? '' : undefined}\n class={cn('scroll-fade overflow-x-auto', {\n // A capped body scrolls on both axes; the region is already a tab stop,\n // so the keyboard reaches the vertical overflow the same way.\n 'overflow-y-auto': local.maxHeight !== undefined,\n '[&_pre]:whitespace-pre-wrap [&_pre]:[overflow-wrap:anywhere]': local.wrap,\n })}\n style={maxHeight() === undefined ? undefined : { 'max-height': maxHeight() }}\n // A region that scrolls must be focusable, and a tab stop needs a name.\n // A `group`, not a `region`: a landmark with the same role and name as the\n // next block's (\"ts code\" twice) is a duplicate in the screen reader's\n // landmark list, and a long answer would fill that list with code blocks.\n tabindex=\"0\"\n role=\"group\"\n aria-label={groupLabel()}\n >\n <Show\n when={highlighter()}\n fallback={\n <pre\n class={cn('m-0', small() ? 'px-2 py-1.5' : 'px-3 py-2')}\n style={{ 'line-height': local.lineHeight ?? '1.5' }}\n >\n <code class=\"font-code text-code\">\n <Show when={perLine()} fallback={local.code.replace(/\\n$/, '')}>\n <For each={visibleLines()}>\n {(line, index) => (\n <CodeLine\n line={line}\n number={index() + 1}\n numbered={local.showLineNumbers === true}\n mark={local.lineMarks?.[index() + 1]}\n wrap={local.wrap === true}\n />\n )}\n </For>\n </Show>\n </code>\n </pre>\n }\n >\n {(highlight) => (\n <div class={small() ? 'px-2 py-1.5' : 'px-3 py-2'}>\n {highlight()(hiddenLines() > 0 ? visibleLines().join('\\n') : local.code)}\n </div>\n )}\n </Show>\n <Show when={truncated()}>\n <div class=\"flex items-center gap-2 border-t border-border px-3 py-1 text-xs text-muted-foreground\">\n <span>\n Showing the first {visibleLines().length.toLocaleString()} of{' '}\n {lines().length.toLocaleString()} lines.\n </span>\n <Button\n variant=\"ghost\"\n size=\"2xs\"\n onClick={() => {\n setShowAll(true)\n // This button leaves the document with the click; the scroller\n // is the nearest place focus can stay, so a keyboard user keeps their place.\n bodyElement?.focus({ preventScroll: true })\n }}\n >\n Show all {lines().length.toLocaleString()} lines\n </Button>\n </div>\n </Show>\n {/*\n In the scroller's box, and a single line: the indicator must not add\n height when it disappears, or a streaming block shifts everything below\n it as it resolves.\n */}\n <Show when={!local.complete}>\n <p class=\"px-3 pb-2 text-xs text-muted-foreground italic\">Generating…</p>\n </Show>\n </div>\n <Show when={tall()}>\n <div\n data-code-block-footer=\"\"\n class=\"flex items-center justify-end border-t border-transparent px-3 py-1 transition-colors group-focus-within/code:border-border group-hover/code:border-border\"\n >\n <Actions />\n </div>\n </Show>\n </div>\n )\n}\n\nconst MARK_GLYPH: Readonly<Record<CodeLineMark, string>> = {\n add: '+',\n remove: '−',\n highlight: '',\n error: '!',\n}\n\n/**\n * One rendered line. The gutter glyph and the element (`ins`/`del`) carry what a\n * mark means so it survives greyscale and a screen reader; both gutters are\n * unselectable so dragging across the block and copying yields only source.\n */\nfunction CodeLine(props: {\n line: string\n number: number\n numbered: boolean\n mark?: CodeLineMark\n wrap: boolean\n}) {\n const content = () => (\n <>\n <Show when={props.numbered}>\n <span class=\"text-right text-muted-foreground select-none\" aria-hidden=\"true\">\n {props.number}\n </span>\n </Show>\n <span\n class=\"w-[1ch] text-center text-muted-foreground select-none\"\n aria-hidden=\"true\"\n data-slot=\"code-line-mark\"\n >\n {props.mark ? MARK_GLYPH[props.mark] : ''}\n </span>\n <span class={cn({ 'min-w-0': props.wrap })}>{props.line || ' '}</span>\n </>\n )\n const rowClass = () =>\n cn(\n 'grid gap-3 no-underline',\n props.numbered ? 'grid-cols-[3ch_1ch_1fr]' : 'grid-cols-[1ch_1fr]',\n {\n 'bg-success-subtle': props.mark === 'add',\n 'bg-destructive-subtle': props.mark === 'remove' || props.mark === 'error',\n 'bg-primary-subtle': props.mark === 'highlight',\n }\n )\n return (\n <Show\n when={props.mark === 'add' || props.mark === 'remove'}\n fallback={\n <span data-mark={props.mark} class={rowClass()}>\n {content()}\n </span>\n }\n >\n <Show\n when={props.mark === 'add'}\n fallback={\n <del data-mark=\"remove\" class={rowClass()}>\n {content()}\n </del>\n }\n >\n <ins data-mark=\"add\" class={rowClass()}>\n {content()}\n </ins>\n </Show>\n </Show>\n )\n}\n\n/**\n * InlineCode.\n *\n * The `code` inside a sentence. It is a component rather than a class because it\n * has to hold three properties at once: it uses the shared code family and size\n * preference, and it wraps rather than overflows a narrow column\n * (`overflow-wrap: anywhere` — an identifier with\n * no spaces is one long token), and it must be legible against whatever surface\n * it lands on, which is why the fill is a token and not a fixed grey.\n */\nexport function InlineCode(props: ComponentProps<'code'>) {\n const local = props\n const rest = omit(props, 'class')\n\n return (\n <code\n class={cn(\n 'rounded-sm bg-muted px-[0.4em] py-[0.15em] font-code text-code text-foreground [overflow-wrap:anywhere]',\n local.class\n )}\n {...rest}\n />\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAYA,IAAMmC,UAAQ,SAASC,KAAW;AAClC,IAAMC,SAAO,SAASC,IAAU;AA+HhC,IAAa,wBAAwB;AAErC,IAAa,qBAAqB;AAElC,IAAM,WAA8B,CAAC;AAErC,SAAgB,UAAU,OAAuB;CAC/C,MAAM,QAAQ;CACd,MAAM,OAAO,KACX,OACA,Q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AEK,IAAA,SAAA,SAAA;IAFL,OAAA,QACG,OACE;IAFmB,aAAAA,YAAO,SAAS,CAAC,IAAjB,KAAA,QAAA;KAAiB,UAAA,QAAA,KAAA,GAAA;;IAAzC,OAAA;GAEK,EAAA,CAAA;EAMH,CAAA,WAhBJ;GAEM,IAAA,SAAA,QAAA;GAFN,OAAA,QACG,OACG;GAFA,aAAA;;KAAW,GAAA,MAAM;KAAMN,GAAAA,YAAO,SAAS,CAAC;IAAnB;GAArB,IAAA,EAAA,GAAA,KAAA,QAAA;IAAqB,MAAA,KAAA,KAAAQ,aAAA,QAAA,aAAA,CAAA;IAAE,UAAA,QAAA,GAAA,KAAA,CAAiB;GAAnB,CAAA;GAA3B,OAAA;EAEM,EAAA,CAAA;CAeJ,CAAA;AAEV;;;;;;;;;;;AAYA,SAAgB,WAAW,OAA+B;CACxD,MAAM,QAAQ;CACd,MAAM,OAAO,KAAK,OAAO,OAAO;CAG9B,IAAA,SAAA,SAMC;CADC,OAAA,QAAA,CAAA,EAJA,IAAA,UAAA;EAAO,OAAA,GACL,2GACA,MAAM,KACR;CAAC,EACO,GAAJ,IAAA,GAAA,KAAA;CANR,OACEP;AAQJ"}
1
+ {"version":3,"file":"code-block.js","names":["<div class=\"flex items-center gap-1 opacity-0 transition-opacity group-focus-within/code:opacity-100 group-hover/code:opacity-100 [@media(hover:none)]:opacity-100\">\n {local.actions}\n <ActionButton\n variant=\"ghost\"\n size=\"icon-2xs\"\n touchTarget=\"comfortable\"\n aria-label={copied() ? (local.copiedLabel ?? 'Copied') : (local.copyLabel ?? 'Copy code')}\n tooltip={local.copyLabel ?? 'Copy code'}\n title={failed() ? 'Copying is unavailable in this context' : undefined}\n onClick={() => void copy()}\n >\n <Show when={copied()} fallback={<Copy aria-hidden=\"true\" />}>\n <Check aria-hidden=\"true\" />\n </Show>\n </ActionButton>\n </div>","<ActionButton\n variant=\"ghost\"\n size=\"icon-2xs\"\n touchTarget=\"comfortable\"\n aria-label={copied() ? (local.copiedLabel ?? 'Copied') : (local.copyLabel ?? 'Copy code')}\n tooltip={local.copyLabel ?? 'Copy code'}\n title={failed() ? 'Copying is unavailable in this context' : undefined}\n onClick={() => void copy()}\n >\n <Show when={copied()} fallback={<Copy aria-hidden=\"true\" />}>\n <Check aria-hidden=\"true\" />\n </Show>\n </ActionButton>","variant=\"ghost\"","size=\"icon-2xs\"","touchTarget=\"comfortable\"","copied() ? (local.copiedLabel ?? 'Copied') : (local.copyLabel ?? 'Copy code')","onClick={() => void copy()}","<Show when={copied()} fallback={<Copy aria-hidden=\"true\" />}>\n <Check aria-hidden=\"true\" />\n </Show>","<Check aria-hidden=\"true\" />","<Copy aria-hidden=\"true\" />","ref={(element: HTMLDivElement) => {\n root = element\n // Composed rather than replaced: a caller's ref must survive.\n forwardRef(() => local.ref, element)\n }}","<Actions />","ref={(element: HTMLDivElement) => (bodyElement = element)}","<Show\n when={highlighter()}\n fallback={\n <pre\n class={cn('m-0', small() ? 'px-2 py-1.5' : 'px-3 py-2')}\n style={{ 'line-height': local.lineHeight ?? '1.5' }}\n >\n <code class=\"font-code text-code\">\n <Show when={perLine()} fallback={local.code.replace(/\\n$/, '')}>\n <For each={visibleLines()}>\n {(line, index) => (\n <CodeLine\n line={line}\n number={index() + 1}\n numbered={local.showLineNumbers === true}\n mark={local.lineMarks?.[index() + 1]}\n wrap={local.wrap === true}\n />\n )}\n </For>\n </Show>\n </code>\n </pre>\n }\n >\n {(highlight) => (\n <div class={small() ? 'px-2 py-1.5' : 'px-3 py-2'}>\n {highlight()(hiddenLines() > 0 ? visibleLines().join('\\n') : local.code)}\n </div>\n )}\n </Show>","<For each={visibleLines()}>\n {(line, index) => (\n <CodeLine\n line={line}\n number={index() + 1}\n numbered={local.showLineNumbers === true}\n mark={local.lineMarks?.[index() + 1]}\n wrap={local.wrap === true}\n />\n )}\n </For>","<CodeLine\n line={line}\n number={index() + 1}\n numbered={local.showLineNumbers === true}\n mark={local.lineMarks?.[index() + 1]}\n wrap={local.wrap === true}\n />","'line-height': local.lineHeight ?? '1.5'","<pre\n class={cn('m-0', small() ? 'px-2 py-1.5' : 'px-3 py-2')}\n style={{ 'line-height': local.lineHeight ?? '1.5' }}\n >\n <code class=\"font-code text-code\">\n <Show when={perLine()} fallback={local.code.replace(/\\n$/, '')}>\n <For each={visibleLines()}>\n {(line, index) => (\n <CodeLine\n line={line}\n number={index() + 1}\n numbered={local.showLineNumbers === true}\n mark={local.lineMarks?.[index() + 1]}\n wrap={local.wrap === true}\n />\n )}\n </For>\n </Show>\n </code>\n </pre>","<div\n ref={(element: HTMLDivElement) => (bodyElement = element)}\n data-slot=\"code-block-body\"\n data-wrap={local.wrap ? '' : undefined}\n class={cn('scroll-fade overflow-x-auto', {\n // A capped body scrolls on both axes; the region is already a tab stop,\n // so the keyboard reaches the vertical overflow the same way.\n 'overflow-y-auto': local.maxHeight !== undefined,\n '[&_pre]:whitespace-pre-wrap [&_pre]:[overflow-wrap:anywhere]': local.wrap,\n })}\n style={maxHeight() === undefined ? undefined : { 'max-height': maxHeight() }}\n // A region that scrolls must be focusable, and a tab stop needs a name.\n // A `group`, not a `region`: a landmark with the same role and name as the\n // next block's (\"ts code\" twice) is a duplicate in the screen reader's\n // landmark list, and a long answer would fill that list with code blocks.\n tabindex=\"0\"\n role=\"group\"\n aria-label={groupLabel()}\n >\n <Show\n when={highlighter()}\n fallback={\n <pre\n class={cn('m-0', small() ? 'px-2 py-1.5' : 'px-3 py-2')}\n style={{ 'line-height': local.lineHeight ?? '1.5' }}\n >\n <code class=\"font-code text-code\">\n <Show when={perLine()} fallback={local.code.replace(/\\n$/, '')}>\n <For each={visibleLines()}>\n {(line, index) => (\n <CodeLine\n line={line}\n number={index() + 1}\n numbered={local.showLineNumbers === true}\n mark={local.lineMarks?.[index() + 1]}\n wrap={local.wrap === true}\n />\n )}\n </For>\n </Show>\n </code>\n </pre>\n }\n >\n {(highlight) => (\n <div class={small() ? 'px-2 py-1.5' : 'px-3 py-2'}>\n {highlight()(hiddenLines() > 0 ? visibleLines().join('\\n') : local.code)}\n </div>\n )}\n </Show>\n <Show when={truncated()}>\n <div class=\"flex items-center gap-2 border-t border-border px-3 py-1 text-xs text-muted-foreground\">\n <span>\n Showing the first {visibleLines().length.toLocaleString()} of{' '}\n {lines().length.toLocaleString()} lines.\n </span>\n <Button\n variant=\"ghost\"\n size=\"2xs\"\n onClick={() => {\n setShowAll(true)\n // This button leaves the document with the click; the scroller\n // is the nearest place focus can stay, so a keyboard user keeps their place.\n bodyElement?.focus({ preventScroll: true })\n }}\n >\n Show all {lines().length.toLocaleString()} lines\n </Button>\n </div>\n </Show>\n {/*\n In the scroller's box, and a single line: the indicator must not add\n height when it disappears, or a streaming block shifts everything below\n it as it resolves.\n */}\n <Show when={!local.complete}>\n <p class=\"px-3 pb-2 text-xs text-muted-foreground italic\">Generating…</p>\n </Show>\n </div>","<span>\n Showing the first {visibleLines().length.toLocaleString()} of{' '}\n {lines().length.toLocaleString()} lines.\n </span>","<Button\n variant=\"ghost\"\n size=\"2xs\"\n onClick={() => {\n setShowAll(true)\n // This button leaves the document with the click; the scroller\n // is the nearest place focus can stay, so a keyboard user keeps their place.\n bodyElement?.focus({ preventScroll: true })\n }}\n >\n Show all {lines().length.toLocaleString()} lines\n </Button>","size=\"2xs\"","onClick={() => {\n setShowAll(true)\n // This button leaves the document with the click; the scroller\n // is the nearest place focus can stay, so a keyboard user keeps their place.\n bodyElement?.focus({ preventScroll: true })\n }}","lines().length.toLocaleString()","<p class=\"px-3 pb-2 text-xs text-muted-foreground italic\">Generating…</p>","data-wrap={local.wrap ? '' : undefined}","class={cn('scroll-fade overflow-x-auto', {\n // A capped body scrolls on both axes; the region is already a tab stop,\n // so the keyboard reaches the vertical overflow the same way.\n 'overflow-y-auto': local.maxHeight !== undefined,\n '[&_pre]:whitespace-pre-wrap [&_pre]:[overflow-wrap:anywhere]': local.wrap,\n })}","style={maxHeight() === undefined ? undefined : { 'max-height': maxHeight() }}","aria-label={groupLabel()}","<div\n data-slot=\"code-block\"\n data-size={local.size ?? 'default'}\n class={cn(\n 'group/code overflow-hidden border border-border bg-card',\n small() ? 'rounded-lg' : 'rounded-xl',\n local.class\n )}\n {...rest}\n ref={(element: HTMLDivElement) => {\n root = element\n // Composed rather than replaced: a caller's ref must survive.\n forwardRef(() => local.ref, element)\n }}\n >\n <div\n class={cn('flex items-center justify-between gap-2', small() ? 'px-2 py-0.5' : 'px-3 py-1')}\n >\n <span class=\"truncate font-code text-code text-muted-foreground\">{label()}</span>\n <Actions />\n </div>\n <div\n ref={(element: HTMLDivElement) => (bodyElement = element)}\n data-slot=\"code-block-body\"\n data-wrap={local.wrap ? '' : undefined}\n class={cn('scroll-fade overflow-x-auto', {\n // A capped body scrolls on both axes; the region is already a tab stop,\n // so the keyboard reaches the vertical overflow the same way.\n 'overflow-y-auto': local.maxHeight !== undefined,\n '[&_pre]:whitespace-pre-wrap [&_pre]:[overflow-wrap:anywhere]': local.wrap,\n })}\n style={maxHeight() === undefined ? undefined : { 'max-height': maxHeight() }}\n // A region that scrolls must be focusable, and a tab stop needs a name.\n // A `group`, not a `region`: a landmark with the same role and name as the\n // next block's (\"ts code\" twice) is a duplicate in the screen reader's\n // landmark list, and a long answer would fill that list with code blocks.\n tabindex=\"0\"\n role=\"group\"\n aria-label={groupLabel()}\n >\n <Show\n when={highlighter()}\n fallback={\n <pre\n class={cn('m-0', small() ? 'px-2 py-1.5' : 'px-3 py-2')}\n style={{ 'line-height': local.lineHeight ?? '1.5' }}\n >\n <code class=\"font-code text-code\">\n <Show when={perLine()} fallback={local.code.replace(/\\n$/, '')}>\n <For each={visibleLines()}>\n {(line, index) => (\n <CodeLine\n line={line}\n number={index() + 1}\n numbered={local.showLineNumbers === true}\n mark={local.lineMarks?.[index() + 1]}\n wrap={local.wrap === true}\n />\n )}\n </For>\n </Show>\n </code>\n </pre>\n }\n >\n {(highlight) => (\n <div class={small() ? 'px-2 py-1.5' : 'px-3 py-2'}>\n {highlight()(hiddenLines() > 0 ? visibleLines().join('\\n') : local.code)}\n </div>\n )}\n </Show>\n <Show when={truncated()}>\n <div class=\"flex items-center gap-2 border-t border-border px-3 py-1 text-xs text-muted-foreground\">\n <span>\n Showing the first {visibleLines().length.toLocaleString()} of{' '}\n {lines().length.toLocaleString()} lines.\n </span>\n <Button\n variant=\"ghost\"\n size=\"2xs\"\n onClick={() => {\n setShowAll(true)\n // This button leaves the document with the click; the scroller\n // is the nearest place focus can stay, so a keyboard user keeps their place.\n bodyElement?.focus({ preventScroll: true })\n }}\n >\n Show all {lines().length.toLocaleString()} lines\n </Button>\n </div>\n </Show>\n {/*\n In the scroller's box, and a single line: the indicator must not add\n height when it disappears, or a streaming block shifts everything below\n it as it resolves.\n */}\n <Show when={!local.complete}>\n <p class=\"px-3 pb-2 text-xs text-muted-foreground italic\">Generating…</p>\n </Show>\n </div>\n <Show when={tall()}>\n <div\n data-code-block-footer=\"\"\n class=\"flex items-center justify-end border-t border-transparent px-3 py-1 transition-colors group-focus-within/code:border-border group-hover/code:border-border\"\n >\n <Actions />\n </div>\n </Show>\n </div>","<Show when={props.numbered}>\n <span class=\"text-right text-muted-foreground select-none\" aria-hidden=\"true\">\n {props.number}\n </span>\n </Show>","<Show\n when={props.mark === 'add' || props.mark === 'remove'}\n fallback={\n <span data-mark={props.mark} class={rowClass()}>\n {content()}\n </span>\n }\n >\n <Show\n when={props.mark === 'add'}\n fallback={\n <del data-mark=\"remove\" class={rowClass()}>\n {content()}\n </del>\n }\n >\n <ins data-mark=\"add\" class={rowClass()}>\n {content()}\n </ins>\n </Show>\n </Show>","<Show\n when={props.mark === 'add'}\n fallback={\n <del data-mark=\"remove\" class={rowClass()}>\n {content()}\n </del>\n }\n >\n <ins data-mark=\"add\" class={rowClass()}>\n {content()}\n </ins>\n </Show>","class={rowClass()}","<code\n class={cn(\n 'rounded-sm bg-muted px-[0.4em] py-[0.15em] font-code text-code text-foreground [overflow-wrap:anywhere]',\n local.class\n )}\n {...rest}\n />","LucideCheck","LucideCopy","_$insert","_$spread","_$ref","_$effect","_$readShallow","_$className","_$setStyleProperty","_$setAttribute","_$style"],"sources":["../../../../src/components/ui/code-block/code-block.tsx"],"sourcesContent":["import { createEffect, createMemo, createSignal, For, onSettled, Show, omit } from 'solid-js'\nimport { type ComponentProps, type JSX } from '@solidjs/web'\nimport { Check as LucideCheck, Copy as LucideCopy } from '@lucide/solid'\nimport { createCopyFeedback } from '#lib/clipboard'\nimport { observeResize } from '#lib/observe-resize'\nimport { cn } from '#lib/utils'\nimport { ActionButton } from '../../composites/action-button'\nimport { Button } from '../button'\nimport { fastIcon } from '#lib/fast-icon'\nimport { forwardRef } from '#lib/refs'\n\n// lucide icons drawn from a cloned template (see fastIcon).\nconst Check = fastIcon(LucideCheck)\nconst Copy = fastIcon(LucideCopy)\n\n/**\n * CodeBlock.\n *\n * A fenced block, rendered as a surface. The library ships no highlighter —\n * syntax colouring is a large dependency with its own theme format, and a\n * component that bundled one would force every consumer to pay for it. This\n * renders the block, its chrome, and its behaviour; a caller that wants\n * highlighting passes the result through `highlight`, which is the seam a\n * Shiki/Pierre/Prism integration plugs into.\n *\n * Four details are the reason this exists rather than a styled `<pre>`:\n *\n * **Copy confirms only on success.** `navigator.clipboard.writeText` rejects\n * outside a secure context, in a sandboxed frame, and when the document is not\n * focused. Flipping to a tick unconditionally confirms a copy that did not\n * happen, and the reader pastes something stale and does not know why. The\n * rejection is caught and the button reports the failure instead.\n *\n * **A tall block repeats its action row at the bottom.** Copying from a block\n * that is taller than the viewport otherwise costs a scroll back to the top and\n * another scroll down to where you were. The threshold is a fixed 480px rather\n * than viewport-relative so the behaviour does not change when the window is\n * resized.\n *\n * **The scroller is focusable and named.** A horizontally scrollable region has\n * to be reachable by keyboard — this is axe's `scrollable-region-focusable`, and\n * a region that scrolls but cannot be focused is a WCAG 2.1.1 failure. It is a\n * labelled `group` rather than a bare `tabindex`, so the tab stop announces what\n * it is. It is deliberately not a `region` landmark: a transcript holds many\n * blocks, often in one language, and repeated landmarks of one name are noise.\n *\n * **Resolving a streaming block must not move the reader.** When `complete` is\n * false the block shows the code it has plus a generating indicator; the\n * indicator is inside the scroller's own box and does not add a line, because a\n * block that grows the moment its content resolves shifts everything below it.\n * If a caller's `highlight` changes the line box, that is the caller's height to\n * hold — `lineHeight` is a prop for exactly that reason.\n *\n * ## Output, not only source\n *\n * The same surface carries terminal output, logs and diffs inside an agent's\n * activity, so it also:\n *\n * - **loads its highlighter lazily** (`loadHighlight`). The grammar is fetched\n * only for a block that is complete and has a language, the block renders plain\n * until it arrives, and a loader that returns nothing — an unknown language, a\n * failed fetch — leaves the plain text in place without an error. Highlighting\n * a block on every streamed delta would re-tokenise the whole thing per token,\n * so a streaming block stays plain until `complete`.\n * - **marks lines** (`lineMarks`) as added, removed, highlighted or failed. A mark\n * is carried by a gutter glyph and by `<ins>`/`<del>` for the two that change\n * text, never by colour alone, and the glyph is not selectable so a copied\n * selection stays the source.\n * - **copies the source exactly.** The copy button writes `code` as given: no\n * trailing-newline trimming, no line numbers, no gutter glyphs, and the whole\n * block even when only part of it is rendered (`lineLimit`).\n * - **bounds a large render.** Past `lineLimit` lines the per-line renderer and a\n * highlighted render show the first lines and a control to show the rest,\n * because tens of thousands of row elements, or a tokenizer run over all of\n * them, are a freeze, not a transcript. Which renderer is in use is decided\n * at the time, so a highlighter that loads late takes over the bound from the\n * per-line rows and the note below the block always describes what is drawn.\n * The plain renderer is a single text node and needs no limit.\n * - **comes in a small size** (`size=\"sm\"`) for tool output inside a Trace line.\n */\nexport type CodeBlockProps = Omit<ComponentProps<'div'>, 'children' | 'onCopy'> & {\n code: string\n /** The language, shown in the header and used as the region's label. */\n language?: string\n /** The code, transformed — highlighted HTML or a component. Omit for plain text. */\n highlight?: (code: string) => JSX.Element\n /** False while the block is still streaming. Adds a generating indicator. */\n complete?: boolean\n /** A filename or title, shown instead of the language. */\n title?: string\n /** Extra header controls, before the copy button. */\n actions?: JSX.Element\n /** Copy label. Override for a non-English application. */\n copyLabel?: string\n copiedLabel?: string\n /** Line height of the rendered code. Set it when `highlight` changes the box. */\n lineHeight?: string\n /** A line-number gutter. Off by default; a short snippet rarely needs one. */\n showLineNumbers?: boolean\n /** The height above which the action row is repeated below the block. */\n tallThreshold?: number\n /**\n * Cap the code body's height and scroll it vertically past that. A number is\n * pixels; a string is any CSS length (`'20rem'`, `'50vh'`). Unset, the block\n * grows with its content.\n */\n maxHeight?: number | string\n /**\n * Soft-wrap long lines inside the block instead of scrolling sideways. Off by\n * default: wrapped code loses its column alignment, so it is for prose-like\n * output (logs, long commands) in a narrow column. Wraps the plain renderer and\n * any `pre` inside `highlight` output; line numbers stay on the first visual line.\n */\n wrap?: boolean\n /** `sm` is the compact chrome for output nested inside a Trace line. */\n size?: 'default' | 'sm'\n /**\n * Marks on 1-based line numbers. Applies to the per-line renderer, which is\n * used whenever marks or line numbers are present and no highlighter is in use,\n * given as `highlight` or loaded by `loadHighlight`: a highlighter replaces the\n * rows, so the marks and the gutter go with them.\n */\n lineMarks?: Readonly<Record<number, CodeLineMark>>\n /**\n * Resolve a highlighter for the block's language. Called once the block is\n * complete; resolving to `undefined` (or rejecting) keeps the plain rendering.\n */\n loadHighlight?: (language: string | undefined) => Promise<CodeHighlighter | undefined>\n /**\n * Lines the per-line and the highlighted renderer show before offering the\n * rest. Default 2000. The plain renderer is one text node and is not limited.\n */\n lineLimit?: number\n /** Called after each copy attempt with whether the clipboard accepted it. */\n onCopy?: (ok: boolean) => void\n}\n\nexport type CodeLineMark = 'add' | 'remove' | 'highlight' | 'error'\nexport type CodeHighlighter = (code: string) => JSX.Element\n\nexport const CODE_BLOCK_LINE_LIMIT = 2_000\n\nexport const TALL_CODE_BLOCK_PX = 480\n\nconst NO_LINES: readonly string[] = []\n\nexport function CodeBlock(props: CodeBlockProps) {\n const local = props\n const rest = omit(\n props,\n 'code',\n 'language',\n 'highlight',\n 'complete',\n 'title',\n 'actions',\n 'copyLabel',\n 'copiedLabel',\n 'lineHeight',\n 'showLineNumbers',\n 'tallThreshold',\n 'maxHeight',\n 'wrap',\n 'size',\n 'lineMarks',\n 'loadHighlight',\n 'lineLimit',\n 'onCopy',\n 'class',\n 'ref'\n )\n\n const { copied, failed, copy: copyText } = createCopyFeedback()\n const [tall, setTall] = createSignal(false)\n\n const [loaded, setLoaded] = createSignal<CodeHighlighter>()\n const [showAll, setShowAll] = createSignal(false)\n let bodyElement: HTMLDivElement | undefined\n let root: HTMLDivElement | undefined\n\n // A language string can come from untrusted model output. It is rendered as\n // text, so it cannot inject markup; the cap keeps a pathological one from\n // swallowing the header.\n const language = () => local.language?.trim().slice(0, 40) || undefined\n const label = () => local.title ?? language() ?? 'code'\n const groupLabel = () => (language() ? `${language()} code` : 'code')\n const small = () => local.size === 'sm'\n const highlighter = (): CodeHighlighter | undefined => local.highlight ?? loaded()\n const perLine = () =>\n highlighter() === undefined && (local.showLineNumbers === true || local.lineMarks !== undefined)\n const usesLines = () => highlighter() !== undefined || perLine()\n // Memos run eagerly, so the split is gated on a renderer that reads lines: a\n // streaming plain block would otherwise split its whole text on every delta.\n const lines = createMemo((): readonly string[] =>\n usesLines() ? local.code.replace(/\\n$/, '').split('\\n') : NO_LINES\n )\n const lineLimit = () => local.lineLimit ?? CODE_BLOCK_LINE_LIMIT\n const visibleLines = createMemo(() => (showAll() ? lines() : lines().slice(0, lineLimit())))\n const hiddenLines = () => lines().length - visibleLines().length\n\n // Load once the block has stopped changing. The compute keys the effect to the\n // language and completion, not to every streamed character, and a stale\n // resolution (the language changed while the grammar was in flight) is dropped.\n createEffect(\n () => ({\n complete: local.complete,\n lang: language(),\n load: local.loadHighlight,\n own: local.highlight !== undefined,\n }),\n ({ complete, lang, load, own }) => {\n setLoaded(undefined)\n if (!complete || !load || own) return\n let current = true\n // Wrapped, not called bare: a loader that throws before it returns a promise\n // (a bad import path, a missing grammar table) must degrade to plain text\n // like one that rejects, not tear down the tree from inside this effect.\n new Promise<CodeHighlighter | undefined>((resolve) => resolve(load(lang))).then(\n (resolved) => {\n if (current && resolved) setLoaded(() => resolved)\n },\n () => undefined\n )\n return () => {\n current = false\n }\n }\n )\n // The renderer in use decides everything about the limit, not the props alone:\n // a highlighter that has loaded since the first render replaces the per-line\n // rows, so what is drawn, and what the footer may say, follows `highlighter()`.\n const truncated = () => usesLines() && hiddenLines() > 0\n const maxHeight = () =>\n typeof local.maxHeight === 'number' ? `${local.maxHeight}px` : local.maxHeight\n\n // Measured rather than assumed: the caller controls the content, so only\n // the rendered box can say whether the action row has scrolled away.\n // The body is what is watched, not the block: the repeated action row is\n // added to the block, so watching the block made this callback resize the\n // very element it observes, which is a ResizeObserver loop (WebKit reports\n // it as an uncaught \"loop completed with undelivered notifications\" error).\n // The footer's own height is left out of the measure for the same reason: a\n // block is tall by its content, not by the row that tallness adds.\n // One observer is shared by every block (see observeResize).\n onSettled(() => {\n const block = root\n if (!block || !bodyElement) return\n const measure = () => {\n const footer = block.querySelector<HTMLElement>('[data-code-block-footer]')\n setTall(\n block.offsetHeight - (footer?.offsetHeight ?? 0) >\n (local.tallThreshold ?? TALL_CODE_BLOCK_PX)\n )\n }\n return observeResize(bodyElement, measure)\n })\n\n const copy = async () => {\n const ok = await copyText(local.code)\n local.onCopy?.(ok)\n }\n\n const Actions = () => (\n <div class=\"flex items-center gap-1 opacity-0 transition-opacity group-focus-within/code:opacity-100 group-hover/code:opacity-100 [@media(hover:none)]:opacity-100\">\n {local.actions}\n <ActionButton\n variant=\"ghost\"\n size=\"icon-2xs\"\n touchTarget=\"comfortable\"\n aria-label={copied() ? (local.copiedLabel ?? 'Copied') : (local.copyLabel ?? 'Copy code')}\n tooltip={local.copyLabel ?? 'Copy code'}\n title={failed() ? 'Copying is unavailable in this context' : undefined}\n onClick={() => void copy()}\n >\n <Show when={copied()} fallback={<Copy aria-hidden=\"true\" />}>\n <Check aria-hidden=\"true\" />\n </Show>\n </ActionButton>\n </div>\n )\n\n return (\n <div\n data-slot=\"code-block\"\n data-size={local.size ?? 'default'}\n class={cn(\n 'group/code overflow-hidden border border-border bg-card',\n small() ? 'rounded-lg' : 'rounded-xl',\n local.class\n )}\n {...rest}\n ref={(element: HTMLDivElement) => {\n root = element\n // Composed rather than replaced: a caller's ref must survive.\n forwardRef(() => local.ref, element)\n }}\n >\n <div\n class={cn('flex items-center justify-between gap-2', small() ? 'px-2 py-0.5' : 'px-3 py-1')}\n >\n <span class=\"truncate font-code text-code text-muted-foreground\">{label()}</span>\n <Actions />\n </div>\n <div\n ref={(element: HTMLDivElement) => (bodyElement = element)}\n data-slot=\"code-block-body\"\n data-wrap={local.wrap ? '' : undefined}\n class={cn('scroll-fade overflow-x-auto', {\n // A capped body scrolls on both axes; the region is already a tab stop,\n // so the keyboard reaches the vertical overflow the same way.\n 'overflow-y-auto': local.maxHeight !== undefined,\n '[&_pre]:whitespace-pre-wrap [&_pre]:[overflow-wrap:anywhere]': local.wrap,\n })}\n style={maxHeight() === undefined ? undefined : { 'max-height': maxHeight() }}\n // A region that scrolls must be focusable, and a tab stop needs a name.\n // A `group`, not a `region`: a landmark with the same role and name as the\n // next block's (\"ts code\" twice) is a duplicate in the screen reader's\n // landmark list, and a long answer would fill that list with code blocks.\n tabindex=\"0\"\n role=\"group\"\n aria-label={groupLabel()}\n >\n <Show\n when={highlighter()}\n fallback={\n <pre\n class={cn('m-0', small() ? 'px-2 py-1.5' : 'px-3 py-2')}\n style={{ 'line-height': local.lineHeight ?? '1.5' }}\n >\n <code class=\"font-code text-code\">\n <Show when={perLine()} fallback={local.code.replace(/\\n$/, '')}>\n <For each={visibleLines()}>\n {(line, index) => (\n <CodeLine\n line={line}\n number={index() + 1}\n numbered={local.showLineNumbers === true}\n mark={local.lineMarks?.[index() + 1]}\n wrap={local.wrap === true}\n />\n )}\n </For>\n </Show>\n </code>\n </pre>\n }\n >\n {(highlight) => (\n <div class={small() ? 'px-2 py-1.5' : 'px-3 py-2'}>\n {highlight()(hiddenLines() > 0 ? visibleLines().join('\\n') : local.code)}\n </div>\n )}\n </Show>\n <Show when={truncated()}>\n <div class=\"flex items-center gap-2 border-t border-border px-3 py-1 text-xs text-muted-foreground\">\n <span>\n Showing the first {visibleLines().length.toLocaleString()} of{' '}\n {lines().length.toLocaleString()} lines.\n </span>\n <Button\n variant=\"ghost\"\n size=\"2xs\"\n onClick={() => {\n setShowAll(true)\n // This button leaves the document with the click; the scroller\n // is the nearest place focus can stay, so a keyboard user keeps their place.\n bodyElement?.focus({ preventScroll: true })\n }}\n >\n Show all {lines().length.toLocaleString()} lines\n </Button>\n </div>\n </Show>\n {/*\n In the scroller's box, and a single line: the indicator must not add\n height when it disappears, or a streaming block shifts everything below\n it as it resolves.\n */}\n <Show when={!local.complete}>\n <p class=\"px-3 pb-2 text-xs text-muted-foreground italic\">Generating…</p>\n </Show>\n </div>\n <Show when={tall()}>\n <div\n data-code-block-footer=\"\"\n class=\"flex items-center justify-end border-t border-transparent px-3 py-1 transition-colors group-focus-within/code:border-border group-hover/code:border-border\"\n >\n <Actions />\n </div>\n </Show>\n </div>\n )\n}\n\nconst MARK_GLYPH: Readonly<Record<CodeLineMark, string>> = {\n add: '+',\n remove: '−',\n highlight: '',\n error: '!',\n}\n\n/**\n * One rendered line. The gutter glyph and the element (`ins`/`del`) carry what a\n * mark means so it survives greyscale and a screen reader; both gutters are\n * unselectable so dragging across the block and copying yields only source.\n */\nfunction CodeLine(props: {\n line: string\n number: number\n numbered: boolean\n mark?: CodeLineMark\n wrap: boolean\n}) {\n const content = () => (\n <>\n <Show when={props.numbered}>\n <span class=\"text-right text-muted-foreground select-none\" aria-hidden=\"true\">\n {props.number}\n </span>\n </Show>\n <span\n class=\"w-[1ch] text-center text-muted-foreground select-none\"\n aria-hidden=\"true\"\n data-slot=\"code-line-mark\"\n >\n {props.mark ? MARK_GLYPH[props.mark] : ''}\n </span>\n <span class={cn({ 'min-w-0': props.wrap })}>{props.line || ' '}</span>\n </>\n )\n const rowClass = () =>\n cn(\n 'grid gap-3 no-underline',\n props.numbered ? 'grid-cols-[3ch_1ch_1fr]' : 'grid-cols-[1ch_1fr]',\n {\n 'bg-success-subtle': props.mark === 'add',\n 'bg-destructive-subtle': props.mark === 'remove' || props.mark === 'error',\n 'bg-primary-subtle': props.mark === 'highlight',\n }\n )\n return (\n <Show\n when={props.mark === 'add' || props.mark === 'remove'}\n fallback={\n <span data-mark={props.mark} class={rowClass()}>\n {content()}\n </span>\n }\n >\n <Show\n when={props.mark === 'add'}\n fallback={\n <del data-mark=\"remove\" class={rowClass()}>\n {content()}\n </del>\n }\n >\n <ins data-mark=\"add\" class={rowClass()}>\n {content()}\n </ins>\n </Show>\n </Show>\n )\n}\n\n/**\n * InlineCode.\n *\n * The `code` inside a sentence. It is a component rather than a class because it\n * has to hold three properties at once: it uses the shared code family and size\n * preference, and it wraps rather than overflows a narrow column\n * (`overflow-wrap: anywhere` — an identifier with\n * no spaces is one long token), and it must be legible against whatever surface\n * it lands on, which is why the fill is a token and not a fixed grey.\n */\nexport function InlineCode(props: ComponentProps<'code'>) {\n const local = props\n const rest = omit(props, 'class')\n\n return (\n <code\n class={cn(\n 'rounded-sm bg-muted px-[0.4em] py-[0.15em] font-code text-code text-foreground [overflow-wrap:anywhere]',\n local.class\n )}\n {...rest}\n />\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAYA,IAAM,QAAQ,SAASmC,OAAW;AAClC,IAAM,OAAO,SAASC,MAAU;AA+HhC,IAAa,wBAAwB;AAErC,IAAa,qBAAqB;AAElC,IAAM,WAA8B,CAAC;AAErC,SAAgB,UAAU,OAAuB;CAC/C,MAAM,QAAQ;CACd,MAAM,OAAO,KACX,OACA,QACA,YACA,aACA,YACA,SACA,WACA,aACA,eACA,cACA,mBACA,iBACA,aACA,QACA,QACA,aACA,iBACA,aACA,UACA,SACA,KACF;CAEA,MAAM,EAAE,QAAQ,QAAQ,MAAM,aAAa,mBAAmB;CAC9D,MAAM,CAAC,MAAM,WAAW,aAAa,KAAK;CAE1C,MAAM,CAAC,QAAQ,aAAa,aAA8B;CAC1D,MAAM,CAAC,SA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A,SAAA,QAAA;GAFNL,OAAA,QACG,OACG;GAFAG,aAAA;;KAAW,GAAA,MAAM;KAAMP,GAAAA,YAAO,SAAS,CAAC;IAAnB;GAArB,IAAA,EAAA,GAAA,KAAA,QAAA;IAAqB,MAAA,KAAA,KAAAW,aAAA,QAAA,aAAA,CAAA;IAAEF,UAAA,QAAA,GAAA,KAAA,CAAiB;GAAnB,CAAA;GAA3B,OAAA;EAEM,EAAA,CAAA;CAeJ,CAAA;AAEV;;;;;;;;;;;AAYA,SAAgB,WAAW,OAA+B;CACxD,MAAM,QAAQ;CACd,MAAM,OAAO,KAAK,OAAO,OAAO;CAG9B,IAAA,SAAA,SAMC;CADCJ,OAAA,QAAA,CAAA,EAJA,IAAA,UAAA;EAAO,OAAA,GACL,2GACA,MAAM,KACR;CAAC,EACO,GAAJ,IAAA,GAAA,KAAA;CANR,OACEJ;AAQJ"}
@@ -1,20 +1,20 @@
1
- import { cn } from "../../../lib/utils.js";
2
1
  import { createComponent, mergeProps } from "@solidjs/web";
2
+ import { Collapsible as Collapsible$1, CollapsiblePanel, CollapsibleTrigger as CollapsibleTrigger$1 } from "@ui-sdk/solid/collapsible";
3
3
  import { omit } from "solid-js";
4
- import { Collapsible, CollapsiblePanel, CollapsibleTrigger } from "@ui-sdk/solid/collapsible";
4
+ import { cn } from "../../../lib/utils.js";
5
5
  // src/components/ui/collapsible/collapsible.tsx
6
- function Collapsible$1(props) {
6
+ function Collapsible(props) {
7
7
  const rest = omit(props, "class", "onOpenChange");
8
- return createComponent(Collapsible, mergeProps({
8
+ return createComponent(Collapsible$1, mergeProps({
9
9
  get "class"() {
10
10
  return cn("flex w-full flex-col", props.class);
11
11
  },
12
12
  onOpenChange: (open) => props.onOpenChange?.(open)
13
13
  }, rest));
14
14
  }
15
- function CollapsibleTrigger$1(props) {
15
+ function CollapsibleTrigger(props) {
16
16
  const rest = omit(props, "class");
17
- return createComponent(CollapsibleTrigger, mergeProps({ get "class"() {
17
+ return createComponent(CollapsibleTrigger$1, mergeProps({ get "class"() {
18
18
  return cn("flex items-center gap-1.5 text-sm font-medium", "transition-colors ease-out outline-none", "focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle", "disabled:pointer-events-none disabled:opacity-50", "data-[disabled]:pointer-events-none data-[disabled]:opacity-50", props.class);
19
19
  } }, rest));
20
20
  }
@@ -29,6 +29,6 @@ function CollapsibleContent(props) {
29
29
  }
30
30
  }, rest));
31
31
  }
32
- export { Collapsible$1 as Collapsible, CollapsibleContent, CollapsibleTrigger$1 as CollapsibleTrigger };
32
+ export { Collapsible, CollapsibleContent, CollapsibleTrigger };
33
33
 
34
34
  //# sourceMappingURL=collapsible.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"collapsible.js","names":["<SdkCollapsible\n class={cn('flex w-full flex-col', props.class as string)}\n onOpenChange={(open) => props.onOpenChange?.(open)}\n {...rest}\n />","onOpenChange={(open) => props.onOpenChange?.(open)}","<SdkCollapsibleTrigger\n class={cn(\n 'flex items-center gap-1.5 text-sm font-medium',\n 'transition-colors ease-out outline-none',\n 'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle',\n 'disabled:pointer-events-none disabled:opacity-50',\n 'data-[disabled]:pointer-events-none data-[disabled]:opacity-50',\n props.class as string\n )}\n {...rest}\n />","<SdkCollapsiblePanel\n keepMounted={props.forceMount}\n class={cn(\n 'overflow-hidden',\n /* The exit keyframes start with `data-closed`, which ui-sdk sets as the\n panel starts to close and waits out before it unmounts the panel. */\n 'data-[open]:animate-in data-[open]:fade-in-0 data-[open]:slide-in-from-top-1',\n 'data-[closed]:animate-out data-[closed]:fade-out-0 data-[closed]:slide-out-to-top-1',\n props.class as string\n )}\n {...rest}\n />","Collapsible","CollapsibleTrigger"],"sources":["../../../../src/components/ui/collapsible/collapsible.tsx"],"sourcesContent":["import {\n Collapsible as SdkCollapsible,\n CollapsiblePanel as SdkCollapsiblePanel,\n CollapsibleTrigger as SdkCollapsibleTrigger,\n} from '@ui-sdk/solid/collapsible'\nimport type { ComponentProps } from '@solidjs/web'\nimport { omit } from 'solid-js'\nimport { cn } from '#lib/utils'\n\n/**\n * Collapsible.\n *\n * One region that shows and hides. Accordion is this in a list; reach for\n * Collapsible when there is exactly one, so a caller does not have to build a\n * one-item accordion whose semantics say \"list of one\".\n *\n * The content animates rather than appearing, which is what keeps a\n * disclosure from reading as a layout jump. ui-sdk keeps the closing panel\n * mounted until its exit animation ends, and publishes the measured height as\n * `--collapsible-panel-height` for a caller that animates the height.\n *\n * State attributes are ui-sdk's: `data-open` while open, `data-closed` while\n * closed (and while animating closed), on the root, the trigger and the panel.\n */\nexport type CollapsibleProps = Omit<ComponentProps<typeof SdkCollapsible>, 'onOpenChange'> & {\n /** Called with the new open state. */\n onOpenChange?: (open: boolean) => void\n}\n\nexport function Collapsible(props: CollapsibleProps) {\n const rest = omit(props, 'class', 'onOpenChange')\n return (\n <SdkCollapsible\n class={cn('flex w-full flex-col', props.class as string)}\n onOpenChange={(open) => props.onOpenChange?.(open)}\n {...rest}\n />\n )\n}\n\nexport function CollapsibleTrigger(props: ComponentProps<typeof SdkCollapsibleTrigger>) {\n const rest = omit(props, 'class')\n\n return (\n <SdkCollapsibleTrigger\n class={cn(\n 'flex items-center gap-1.5 text-sm font-medium',\n 'transition-colors ease-out outline-none',\n 'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle',\n 'disabled:pointer-events-none disabled:opacity-50',\n 'data-[disabled]:pointer-events-none data-[disabled]:opacity-50',\n props.class as string\n )}\n {...rest}\n />\n )\n}\n\nexport type CollapsibleContentProps = ComponentProps<typeof SdkCollapsiblePanel> & {\n /** Keeps the panel in the page, hidden, while closed. */\n forceMount?: boolean\n}\n\nexport function CollapsibleContent(props: CollapsibleContentProps) {\n const rest = omit(props, 'class', 'forceMount')\n return (\n <SdkCollapsiblePanel\n keepMounted={props.forceMount}\n class={cn(\n 'overflow-hidden',\n /* The exit keyframes start with `data-closed`, which ui-sdk sets as the\n panel starts to close and waits out before it unmounts the panel. */\n 'data-[open]:animate-in data-[open]:fade-in-0 data-[open]:slide-in-from-top-1',\n 'data-[closed]:animate-out data-[closed]:fade-out-0 data-[closed]:slide-out-to-top-1',\n props.class as string\n )}\n {...rest}\n />\n )\n}\n"],"mappings":";;;;;AA6BA,SAAgBI,cAAY,OAAyB;CACnD,MAAM,OAAO,KAAK,OAAO,SAAS,cAAc;CAChD,OACEJ,gBAAAA,aAAAA,WAAAA;EACE,IAAA,UAAA;GAAO,OAAA,GAAG,wBAAwB,MAAM,KAAe;EAAC;EACxDC,eAAe,SAAS,MAAM,eAAe,IAAI;CAElD,GADK,IACL,CAAA;AAEL;AAEA,SAAgBI,qBAAmB,OAAqD;CACtF,MAAM,OAAO,KAAK,OAAO,OAAO;CAEhC,OACEH,gBAAAA,oBAAAA,WAAAA,EACE,IAAA,UAAA;EAAO,OAAA,GACL,iDACA,2CACA,oFACA,oDACA,kEACA,MAAM,KACR;CAAC,EAEF,GADK,IACL,CAAA;AAEL;AAOA,SAAgB,mBAAmB,OAAgC;CACjE,MAAM,OAAO,KAAK,OAAO,SAAS,YAAY;CAC9C,OACEC,gBAAAA,kBAAAA,WAAAA;EACE,IAAA,cAAA;GAAa,OAAA,MAAM;EAAU;EAC7B,IAAA,UAAA;GAAO,OAAA,GACL,mBAGA,gFACA,uFACA,MAAM,KACR;EAAC;CAEF,GADK,IACL,CAAA;AAEL"}
1
+ {"version":3,"file":"collapsible.js","names":["<SdkCollapsible\n class={cn('flex w-full flex-col', props.class as string)}\n onOpenChange={(open) => props.onOpenChange?.(open)}\n {...rest}\n />","onOpenChange={(open) => props.onOpenChange?.(open)}","<SdkCollapsibleTrigger\n class={cn(\n 'flex items-center gap-1.5 text-sm font-medium',\n 'transition-colors ease-out outline-none',\n 'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle',\n 'disabled:pointer-events-none disabled:opacity-50',\n 'data-[disabled]:pointer-events-none data-[disabled]:opacity-50',\n props.class as string\n )}\n {...rest}\n />","<SdkCollapsiblePanel\n keepMounted={props.forceMount}\n class={cn(\n 'overflow-hidden',\n /* The exit keyframes start with `data-closed`, which ui-sdk sets as the\n panel starts to close and waits out before it unmounts the panel. */\n 'data-[open]:animate-in data-[open]:fade-in-0 data-[open]:slide-in-from-top-1',\n 'data-[closed]:animate-out data-[closed]:fade-out-0 data-[closed]:slide-out-to-top-1',\n props.class as string\n )}\n {...rest}\n />"],"sources":["../../../../src/components/ui/collapsible/collapsible.tsx"],"sourcesContent":["import {\n Collapsible as SdkCollapsible,\n CollapsiblePanel as SdkCollapsiblePanel,\n CollapsibleTrigger as SdkCollapsibleTrigger,\n} from '@ui-sdk/solid/collapsible'\nimport type { ComponentProps } from '@solidjs/web'\nimport { omit } from 'solid-js'\nimport { cn } from '#lib/utils'\n\n/**\n * Collapsible.\n *\n * One region that shows and hides. Accordion is this in a list; reach for\n * Collapsible when there is exactly one, so a caller does not have to build a\n * one-item accordion whose semantics say \"list of one\".\n *\n * The content animates rather than appearing, which is what keeps a\n * disclosure from reading as a layout jump. ui-sdk keeps the closing panel\n * mounted until its exit animation ends, and publishes the measured height as\n * `--collapsible-panel-height` for a caller that animates the height.\n *\n * State attributes are ui-sdk's: `data-open` while open, `data-closed` while\n * closed (and while animating closed), on the root, the trigger and the panel.\n */\nexport type CollapsibleProps = Omit<ComponentProps<typeof SdkCollapsible>, 'onOpenChange'> & {\n /** Called with the new open state. */\n onOpenChange?: (open: boolean) => void\n}\n\nexport function Collapsible(props: CollapsibleProps) {\n const rest = omit(props, 'class', 'onOpenChange')\n return (\n <SdkCollapsible\n class={cn('flex w-full flex-col', props.class as string)}\n onOpenChange={(open) => props.onOpenChange?.(open)}\n {...rest}\n />\n )\n}\n\nexport function CollapsibleTrigger(props: ComponentProps<typeof SdkCollapsibleTrigger>) {\n const rest = omit(props, 'class')\n\n return (\n <SdkCollapsibleTrigger\n class={cn(\n 'flex items-center gap-1.5 text-sm font-medium',\n 'transition-colors ease-out outline-none',\n 'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle',\n 'disabled:pointer-events-none disabled:opacity-50',\n 'data-[disabled]:pointer-events-none data-[disabled]:opacity-50',\n props.class as string\n )}\n {...rest}\n />\n )\n}\n\nexport type CollapsibleContentProps = ComponentProps<typeof SdkCollapsiblePanel> & {\n /** Keeps the panel in the page, hidden, while closed. */\n forceMount?: boolean\n}\n\nexport function CollapsibleContent(props: CollapsibleContentProps) {\n const rest = omit(props, 'class', 'forceMount')\n return (\n <SdkCollapsiblePanel\n keepMounted={props.forceMount}\n class={cn(\n 'overflow-hidden',\n /* The exit keyframes start with `data-closed`, which ui-sdk sets as the\n panel starts to close and waits out before it unmounts the panel. */\n 'data-[open]:animate-in data-[open]:fade-in-0 data-[open]:slide-in-from-top-1',\n 'data-[closed]:animate-out data-[closed]:fade-out-0 data-[closed]:slide-out-to-top-1',\n props.class as string\n )}\n {...rest}\n />\n )\n}\n"],"mappings":";;;;;AA6BA,SAAgB,YAAY,OAAyB;CACnD,MAAM,OAAO,KAAK,OAAO,SAAS,cAAc;CAChD,OACEA,gBAAAA,eAAAA,WAAAA;EACE,IAAA,UAAA;GAAO,OAAA,GAAG,wBAAwB,MAAM,KAAe;EAAC;EACxDC,eAAe,SAAS,MAAM,eAAe,IAAI;CAElD,GADK,IACL,CAAA;AAEL;AAEA,SAAgB,mBAAmB,OAAqD;CACtF,MAAM,OAAO,KAAK,OAAO,OAAO;CAEhC,OACEC,gBAAAA,sBAAAA,WAAAA,EACE,IAAA,UAAA;EAAO,OAAA,GACL,iDACA,2CACA,oFACA,oDACA,kEACA,MAAM,KACR;CAAC,EAEF,GADK,IACL,CAAA;AAEL;AAOA,SAAgB,mBAAmB,OAAgC;CACjE,MAAM,OAAO,KAAK,OAAO,SAAS,YAAY;CAC9C,OACEC,gBAAAA,kBAAAA,WAAAA;EACE,IAAA,cAAA;GAAa,OAAA,MAAM;EAAU;EAC7B,IAAA,UAAA;GAAO,OAAA,GACL,mBAGA,gFACA,uFACA,MAAM,KACR;EAAC;CAEF,GADK,IACL,CAAA;AAEL"}
@@ -1,20 +1,20 @@
1
+ import { className, createComponent, delegateEvents, dynamic, effect, insert, memo, mergeProps, readShallow, ref, spread, template } from "@solidjs/web";
2
+ import { Combobox as Combobox$1, ComboboxContent as ComboboxContent$1, ComboboxInput as ComboboxInput$1, ComboboxItem as ComboboxItem$1, ComboboxList, ComboboxTrigger as ComboboxTrigger$1 } from "@ui-sdk/solid/combobox";
3
+ import { Check as Check$1, ChevronDown as ChevronDown$1, X as X$1 } from "@lucide/solid";
4
+ import { For, createContext, createMemo, omit, useContext } from "solid-js";
1
5
  import { menuItem } from "../../../lib/overlay.js";
2
6
  import { useFormFieldControl } from "../../../lib/form-field.js";
3
7
  import { cn } from "../../../lib/utils.js";
4
8
  import { fastIcon } from "../../../lib/fast-icon.js";
5
- import { className, createComponent, delegateEvents, dynamic, effect, insert, memo, mergeProps, readShallow, ref, spread, template } from "@solidjs/web";
6
- import { Check, ChevronDown, X } from "@lucide/solid";
7
- import { For, createContext, createMemo, omit, useContext } from "solid-js";
8
- import { Combobox, ComboboxContent, ComboboxInput, ComboboxItem, ComboboxList, ComboboxTrigger } from "@ui-sdk/solid/combobox";
9
9
  // src/components/ui/combobox/combobox.tsx
10
10
  var _tmpl$ = /* @__PURE__ */ template(`<div>`);
11
11
  var _tmpl$2 = /* @__PURE__ */ template(`<span aria-hidden=true>`);
12
12
  var _tmpl$3 = /* @__PURE__ */ template(`<button>`);
13
13
  var _tmpl$4 = /* @__PURE__ */ template(`<span data-slot=combobox-indicator aria-hidden=true class="absolute end-2 flex size-4 items-center justify-center text-primary">`);
14
14
  var _tmpl$5 = /* @__PURE__ */ template(`<button type=button aria-label="Clear selection">`);
15
- var Check$1 = fastIcon(Check);
16
- var ChevronDown$1 = fastIcon(ChevronDown);
17
- var X$1 = fastIcon(X);
15
+ var Check = fastIcon(Check$1);
16
+ var ChevronDown = fastIcon(ChevronDown$1);
17
+ var X = fastIcon(X$1);
18
18
  /**
19
19
  * Calls a caller's `ref`, which Solid 2 hands over as a function or, once
20
20
  * merged with another (a tooltip trigger around a menu trigger), an array.
@@ -45,7 +45,7 @@ function read(accessor, option, fallback) {
45
45
  * collection API on top of it: `options` drawn through `itemComponent`, with
46
46
  * the caller's option object as the value.
47
47
  */
48
- function Combobox$1(props) {
48
+ function Combobox(props) {
49
49
  const rest = omit(props, "options", "optionValue", "optionTextValue", "optionLabel", "optionDisabled", "optionGroupChildren", "itemComponent", "sectionComponent", "placeholder", "multiple", "value", "defaultValue", "onChange", "inputValue", "defaultInputValue", "onInputChange", "defaultFilter", "allowsEmptyCollection", "open", "defaultOpen", "onOpenChange", "disabled", "required", "readOnly", "name", "validationState", "gutter", "children");
50
50
  const keyOf = (option) => String(read(props.optionValue, option, option));
51
51
  const textOf = (option) => read(props.optionTextValue, option, keyOf(option));
@@ -106,7 +106,7 @@ function Combobox$1(props) {
106
106
  insert(_el$, createComponent(ComboboxScopeContext, {
107
107
  value: scope,
108
108
  get children() {
109
- return createComponent(Combobox, {
109
+ return createComponent(Combobox$1, {
110
110
  get multiple() {
111
111
  return props.multiple;
112
112
  },
@@ -180,11 +180,11 @@ function ComboboxControl(props) {
180
180
  }, _el$2);
181
181
  return _el$2;
182
182
  }
183
- function ComboboxInput$1(props) {
183
+ function ComboboxInput(props) {
184
184
  const scope = useContext(ComboboxScopeContext);
185
185
  const rest = omit(props, "class", "id", "aria-label", "aria-labelledby", "aria-describedby", "aria-invalid", "aria-errormessage", "placeholder");
186
186
  const field = useFormFieldControl("control", props);
187
- return createComponent(ComboboxInput, mergeProps(rest, {
187
+ return createComponent(ComboboxInput$1, mergeProps(rest, {
188
188
  get id() {
189
189
  return field?.id ?? props.id;
190
190
  },
@@ -211,9 +211,9 @@ function ComboboxInput$1(props) {
211
211
  }
212
212
  }));
213
213
  }
214
- function ComboboxTrigger$1(props) {
214
+ function ComboboxTrigger(props) {
215
215
  const rest = omit(props, "class", "children");
216
- return createComponent(ComboboxTrigger, mergeProps(rest, {
216
+ return createComponent(ComboboxTrigger$1, mergeProps(rest, {
217
217
  render: (part, state) => (() => {
218
218
  var _el$4 = _tmpl$3();
219
219
  spread(_el$4, [part, { get "data-expanded"() {
@@ -229,16 +229,16 @@ function ComboboxTrigger$1(props) {
229
229
  return props.children;
230
230
  }), (() => {
231
231
  var _el$3 = _tmpl$2();
232
- insert(_el$3, createComponent(ChevronDown$1, { class: "size-4" }));
232
+ insert(_el$3, createComponent(ChevronDown, { class: "size-4" }));
233
233
  return _el$3;
234
234
  })()];
235
235
  }
236
236
  }));
237
237
  }
238
- function ComboboxContent$1(props) {
238
+ function ComboboxContent(props) {
239
239
  const scope = useContext(ComboboxScopeContext);
240
240
  const rest = omit(props, "class", "children");
241
- return createComponent(ComboboxContent, mergeProps(rest, {
241
+ return createComponent(ComboboxContent$1, mergeProps(rest, {
242
242
  anchor: { getBoundingClientRect: () => (scope?.control.current ?? document.body).getBoundingClientRect() },
243
243
  get sideOffset() {
244
244
  return (scope?.gutter() ?? 8) + 15;
@@ -279,9 +279,9 @@ function ComboboxContent$1(props) {
279
279
  }
280
280
  }));
281
281
  }
282
- function ComboboxItem$1(props) {
282
+ function ComboboxItem(props) {
283
283
  const rest = omit(props, "class", "children", "item");
284
- return createComponent(ComboboxItem, mergeProps(rest, {
284
+ return createComponent(ComboboxItem$1, mergeProps(rest, {
285
285
  get value() {
286
286
  return props.item.rawValue;
287
287
  },
@@ -305,7 +305,7 @@ function ComboboxItem$1(props) {
305
305
  return !!state.selected;
306
306
  })() ? (() => {
307
307
  var _el$7 = _tmpl$4();
308
- insert(_el$7, createComponent(Check$1, { class: "size-4" }));
308
+ insert(_el$7, createComponent(Check, { class: "size-4" }));
309
309
  return _el$7;
310
310
  })() : void 0;
311
311
  })]
@@ -331,7 +331,7 @@ function ComboboxClear(props) {
331
331
  })() ? (() => {
332
332
  var _el$9 = _tmpl$5();
333
333
  _el$9._$$click = () => props.onClear();
334
- insert(_el$9, createComponent(X$1, { class: "size-3.5" }));
334
+ insert(_el$9, createComponent(X, { class: "size-3.5" }));
335
335
  effect(() => readShallow(cn("text-muted-foreground flex size-4 shrink-0 items-center justify-center rounded-sm", "transition-colors ease-out outline-none hover:text-foreground", "focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle", props.class)), (_v$, _$p) => {
336
336
  className(_el$9, _v$, _$p);
337
337
  });
@@ -340,6 +340,6 @@ function ComboboxClear(props) {
340
340
  });
341
341
  }
342
342
  delegateEvents(["click"]);
343
- export { Combobox$1 as Combobox, ComboboxClear, ComboboxContent$1 as ComboboxContent, ComboboxControl, ComboboxInput$1 as ComboboxInput, ComboboxItem$1 as ComboboxItem, ComboboxSection, ComboboxTrigger$1 as ComboboxTrigger };
343
+ export { Combobox, ComboboxClear, ComboboxContent, ComboboxControl, ComboboxInput, ComboboxItem, ComboboxSection, ComboboxTrigger };
344
344
 
345
345
  //# sourceMappingURL=combobox.js.map