@adea-ai/ui 0.162.6 → 0.162.7

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":"message.js","names":["<article\n data-slot=\"message\"\n data-role={local.role}\n data-anchor-id={local.anchorId}\n aria-label={local.label}\n aria-busy={local.streaming ? 'true' : undefined}\n class={cn(\n 'group/message mx-auto flex w-full max-w-3xl min-w-0 flex-col gap-2 py-2',\n // The engine may skip layout for turns far off screen; the intrinsic size\n // keeps the scrollbar honest while it does.\n '[content-visibility:auto] [contain-intrinsic-size:auto_6rem]',\n {\n 'items-end ps-[clamp(0rem,12%,4rem)]': local.role === 'user',\n 'items-stretch': local.role !== 'user',\n },\n local.class\n )}\n {...rest}\n >\n {local.children}\n </article>","<Show when={local.avatar}>{(avatarSlot) => <>{avatarSlot()}</>}</Show>","{avatarSlot()}","<header\n data-slot=\"message-header\"\n class={cn('flex items-center gap-2 text-xs text-muted-foreground', local.class)}\n {...rest}\n >\n <Show when={local.avatar}>{(avatarSlot) => <>{avatarSlot()}</>}</Show>\n <span class=\"font-medium text-foreground\">{local.children}</span>\n <Show when={local.time}>{(timeSlot) => <span class=\"tabular-nums\">{timeSlot()}</span>}</Show>\n </header>","<Show when={local.time}>{(timeSlot) => <span class=\"tabular-nums\">{timeSlot()}</span>}</Show>","<div\n data-slot=\"message-content\"\n class={cn(\n 'flex w-full max-w-3xl min-w-0 flex-col gap-3 font-content text-content',\n local.class\n )}\n {...rest}\n >\n {local.children}\n </div>","<div\n data-slot=\"message-actions\"\n class={cn(\n 'flex items-center gap-1 opacity-0 transition-opacity ease-out group-focus-within/message:opacity-100 group-hover/message:opacity-100 [@media(hover:none)]:opacity-100',\n local.class\n )}\n {...rest}\n >\n {local.children}\n </div>","<ActionButton\n type=\"button\"\n variant=\"ghost\"\n size=\"icon-xs\"\n data-slot=\"message-action\"\n aria-label={local.label}\n tooltip={local.label}\n tooltipSide=\"bottom\"\n {...(rest as ActionButtonProps)}\n />","type=\"button\"","variant=\"ghost\"","size=\"icon-xs\"","tooltipSide=\"bottom\"","<MessageAction\n label={label()}\n onClick={() => {\n const text = typeof local.text === 'function' ? local.text() : local.text\n void feedback.copy(text)\n }}\n {...rest}\n >\n <Show when={feedback.copied()} fallback={<Copy />}>\n <Check />\n </Show>\n </MessageAction>","onClick={() => {\n const text = typeof local.text === 'function' ? local.text() : local.text\n void feedback.copy(text)\n }}","<Show when={feedback.copied()} fallback={<Copy />}>\n <Check />\n </Show>","<Check />","<Copy />","<footer\n data-slot=\"message-footer\"\n class={cn('flex min-w-0 items-center gap-2 text-xs text-muted-foreground', local.class)}\n {...rest}\n >\n {local.children}\n </footer>","<For keyed={false} each={blocks()}>\n {(block, index) => (\n <BlockView\n block={block()}\n codeProps={local.codeBlockProps}\n codeIndex={() => codeIndexes()[index] ?? 0}\n citations={local.citations}\n />\n )}\n </For>","keyed={false}","<BlockView\n block={block()}\n codeProps={local.codeBlockProps}\n codeIndex={() => codeIndexes()[index] ?? 0}\n citations={local.citations}\n />","codeIndex={() => codeIndexes()[index] ?? 0}","<div data-slot=\"message-text\" class={cn('flex min-w-0 flex-col gap-3', local.class)} {...rest}>\n <For keyed={false} each={blocks()}>\n {(block, index) => (\n <BlockView\n block={block()}\n codeProps={local.codeBlockProps}\n codeIndex={() => codeIndexes()[index] ?? 0}\n citations={local.citations}\n />\n )}\n </For>\n <Show when={local.streaming && lastIsProse()}>\n <span class=\"streaming-caret\" aria-hidden=\"true\" />\n </Show>\n </div>","<span class=\"streaming-caret\" aria-hidden=\"true\" />","<Switch>\n <Match when={props.block.kind === 'code' && props.block}>\n {(block) => {\n const code = () => block() as Extract<MessageBlock, { kind: 'code' }>\n const chosen = () => {\n const choice = props.codeProps\n return typeof choice === 'function'\n ? choice({\n index: props.codeIndex(),\n language: code().language,\n code: code().code,\n complete: code().complete,\n })\n : choice\n }\n return (\n <CodeBlock\n code={code().code}\n language={code().language}\n complete={code().complete}\n {...chosen()}\n />\n )\n }}\n </Match>\n <Match when={props.block.kind === 'heading' && props.block}>\n {(block) => {\n const heading = () => block() as Extract<MessageBlock, { kind: 'heading' }>\n return (\n <p\n role=\"heading\"\n aria-level={heading().level + 2}\n class=\"font-semibold text-foreground [overflow-wrap:anywhere]\"\n >\n <Inline nodes={heading().inline} citations={props.citations} />\n </p>\n )\n }}\n </Match>\n <Match when={props.block.kind === 'list' && props.block}>\n {(block) => {\n const list = () => block() as Extract<MessageBlock, { kind: 'list' }>\n return (\n <Show\n when={list().ordered}\n fallback={\n <ul class=\"m-0 ms-5 flex list-disc flex-col gap-1 p-0 marker:text-muted-foreground\">\n <For each={list().items}>\n {(item) => (\n <li class=\"[overflow-wrap:anywhere]\">\n <Inline nodes={item} citations={props.citations} />\n </li>\n )}\n </For>\n </ul>\n }\n >\n <ol\n start={list().start}\n class=\"m-0 ms-5 flex list-decimal flex-col gap-1 p-0 marker:text-muted-foreground\"\n >\n <For each={list().items}>\n {(item) => (\n <li class=\"[overflow-wrap:anywhere]\">\n <Inline nodes={item} citations={props.citations} />\n </li>\n )}\n </For>\n </ol>\n </Show>\n )\n }}\n </Match>\n <Match when={props.block.kind === 'quote' && props.block}>\n {(block) => {\n const quote = () => block() as Extract<MessageBlock, { kind: 'quote' }>\n return (\n <blockquote class=\"m-0 border-s-2 border-border ps-3 whitespace-pre-wrap text-muted-foreground [overflow-wrap:anywhere]\">\n <Inline nodes={quote().inline} citations={props.citations} />\n </blockquote>\n )\n }}\n </Match>\n <Match when={props.block.kind === 'paragraph' && props.block}>\n {(block) => {\n const paragraph = () => block() as Extract<MessageBlock, { kind: 'paragraph' }>\n return (\n <p class=\"m-0 whitespace-pre-wrap [overflow-wrap:anywhere]\">\n <Inline nodes={paragraph().inline} citations={props.citations} />\n </p>\n )\n }}\n </Match>\n </Switch>","<Match when={props.block.kind === 'code' && props.block}>\n {(block) => {\n const code = () => block() as Extract<MessageBlock, { kind: 'code' }>\n const chosen = () => {\n const choice = props.codeProps\n return typeof choice === 'function'\n ? choice({\n index: props.codeIndex(),\n language: code().language,\n code: code().code,\n complete: code().complete,\n })\n : choice\n }\n return (\n <CodeBlock\n code={code().code}\n language={code().language}\n complete={code().complete}\n {...chosen()}\n />\n )\n }}\n </Match>","props.block.kind === 'code' && props.block","<CodeBlock\n code={code().code}\n language={code().language}\n complete={code().complete}\n {...chosen()}\n />","<Match when={props.block.kind === 'heading' && props.block}>\n {(block) => {\n const heading = () => block() as Extract<MessageBlock, { kind: 'heading' }>\n return (\n <p\n role=\"heading\"\n aria-level={heading().level + 2}\n class=\"font-semibold text-foreground [overflow-wrap:anywhere]\"\n >\n <Inline nodes={heading().inline} citations={props.citations} />\n </p>\n )\n }}\n </Match>","props.block.kind === 'heading' && props.block","<Inline nodes={heading().inline} citations={props.citations} />","<p\n role=\"heading\"\n aria-level={heading().level + 2}\n class=\"font-semibold text-foreground [overflow-wrap:anywhere]\"\n >\n <Inline nodes={heading().inline} citations={props.citations} />\n </p>","<Match when={props.block.kind === 'list' && props.block}>\n {(block) => {\n const list = () => block() as Extract<MessageBlock, { kind: 'list' }>\n return (\n <Show\n when={list().ordered}\n fallback={\n <ul class=\"m-0 ms-5 flex list-disc flex-col gap-1 p-0 marker:text-muted-foreground\">\n <For each={list().items}>\n {(item) => (\n <li class=\"[overflow-wrap:anywhere]\">\n <Inline nodes={item} citations={props.citations} />\n </li>\n )}\n </For>\n </ul>\n }\n >\n <ol\n start={list().start}\n class=\"m-0 ms-5 flex list-decimal flex-col gap-1 p-0 marker:text-muted-foreground\"\n >\n <For each={list().items}>\n {(item) => (\n <li class=\"[overflow-wrap:anywhere]\">\n <Inline nodes={item} citations={props.citations} />\n </li>\n )}\n </For>\n </ol>\n </Show>\n )\n }}\n </Match>","props.block.kind === 'list' && props.block","<Show\n when={list().ordered}\n fallback={\n <ul class=\"m-0 ms-5 flex list-disc flex-col gap-1 p-0 marker:text-muted-foreground\">\n <For each={list().items}>\n {(item) => (\n <li class=\"[overflow-wrap:anywhere]\">\n <Inline nodes={item} citations={props.citations} />\n </li>\n )}\n </For>\n </ul>\n }\n >\n <ol\n start={list().start}\n class=\"m-0 ms-5 flex list-decimal flex-col gap-1 p-0 marker:text-muted-foreground\"\n >\n <For each={list().items}>\n {(item) => (\n <li class=\"[overflow-wrap:anywhere]\">\n <Inline nodes={item} citations={props.citations} />\n </li>\n )}\n </For>\n </ol>\n </Show>","<For each={list().items}>\n {(item) => (\n <li class=\"[overflow-wrap:anywhere]\">\n <Inline nodes={item} citations={props.citations} />\n </li>\n )}\n </For>","<Inline nodes={item} citations={props.citations} />","nodes={item}","<For each={list().items}>\n {(item) => (\n <li class=\"[overflow-wrap:anywhere]\">\n <Inline nodes={item} citations={props.citations} />\n </li>\n )}\n </For>","<Match when={props.block.kind === 'quote' && props.block}>\n {(block) => {\n const quote = () => block() as Extract<MessageBlock, { kind: 'quote' }>\n return (\n <blockquote class=\"m-0 border-s-2 border-border ps-3 whitespace-pre-wrap text-muted-foreground [overflow-wrap:anywhere]\">\n <Inline nodes={quote().inline} citations={props.citations} />\n </blockquote>\n )\n }}\n </Match>","props.block.kind === 'quote' && props.block","<Inline nodes={quote().inline} citations={props.citations} />","<blockquote class=\"m-0 border-s-2 border-border ps-3 whitespace-pre-wrap text-muted-foreground [overflow-wrap:anywhere]\">\n <Inline nodes={quote().inline} citations={props.citations} />\n </blockquote>","<Match when={props.block.kind === 'paragraph' && props.block}>\n {(block) => {\n const paragraph = () => block() as Extract<MessageBlock, { kind: 'paragraph' }>\n return (\n <p class=\"m-0 whitespace-pre-wrap [overflow-wrap:anywhere]\">\n <Inline nodes={paragraph().inline} citations={props.citations} />\n </p>\n )\n }}\n </Match>","props.block.kind === 'paragraph' && props.block","<Inline nodes={paragraph().inline} citations={props.citations} />","<p class=\"m-0 whitespace-pre-wrap [overflow-wrap:anywhere]\">\n <Inline nodes={paragraph().inline} citations={props.citations} />\n </p>","<For keyed={false} each={props.nodes}>\n {(node) => (\n <Switch>\n {/* Fragments keep the reads reactive: Match runs its callback untracked. */}\n <Match when={node().kind === 'text' && node()}>\n {(text) => <>{(text() as { text: string }).text}</>}\n </Match>\n <Match when={node().kind === 'code' && node()}>\n {(code) => <InlineCode>{(code() as { text: string }).text}</InlineCode>}\n </Match>\n <Match when={node().kind === 'strong' && node()}>\n {(strong) => (\n <strong class=\"font-semibold\">\n <Inline\n nodes={(strong() as { children: readonly MessageInline[] }).children}\n citations={props.citations}\n />\n </strong>\n )}\n </Match>\n <Match when={node().kind === 'em' && node()}>\n {(em) => (\n <em>\n <Inline\n nodes={(em() as { children: readonly MessageInline[] }).children}\n citations={props.citations}\n />\n </em>\n )}\n </Match>\n <Match when={node().kind === 'link' && node()}>\n {(link) => (\n <a\n href={(link() as { href: string }).href}\n target=\"_blank\"\n rel=\"noreferrer noopener\"\n class=\"text-primary underline underline-offset-2 hover:no-underline\"\n >\n <Inline nodes={(link() as { children: readonly MessageInline[] }).children} />\n </a>\n )}\n </Match>\n <Match when={node().kind === 'cite' && node()}>\n {(cite) => {\n const marker = () => cite() as { numbers: readonly number[]; raw: string }\n // The parser read this as a citation only while the host had sources;\n // if they have gone since, the marker is the text it was written as.\n // Match invokes this callback untracked; JSX keeps renderer and\n // same-count source replacements reactive without replacing the block.\n return (\n <>{props.citations ? props.citations.render(marker().numbers) : marker().raw}</>\n )\n }}\n </Match>\n </Switch>\n )}\n </For>","<Switch>\n {/* Fragments keep the reads reactive: Match runs its callback untracked. */}\n <Match when={node().kind === 'text' && node()}>\n {(text) => <>{(text() as { text: string }).text}</>}\n </Match>\n <Match when={node().kind === 'code' && node()}>\n {(code) => <InlineCode>{(code() as { text: string }).text}</InlineCode>}\n </Match>\n <Match when={node().kind === 'strong' && node()}>\n {(strong) => (\n <strong class=\"font-semibold\">\n <Inline\n nodes={(strong() as { children: readonly MessageInline[] }).children}\n citations={props.citations}\n />\n </strong>\n )}\n </Match>\n <Match when={node().kind === 'em' && node()}>\n {(em) => (\n <em>\n <Inline\n nodes={(em() as { children: readonly MessageInline[] }).children}\n citations={props.citations}\n />\n </em>\n )}\n </Match>\n <Match when={node().kind === 'link' && node()}>\n {(link) => (\n <a\n href={(link() as { href: string }).href}\n target=\"_blank\"\n rel=\"noreferrer noopener\"\n class=\"text-primary underline underline-offset-2 hover:no-underline\"\n >\n <Inline nodes={(link() as { children: readonly MessageInline[] }).children} />\n </a>\n )}\n </Match>\n <Match when={node().kind === 'cite' && node()}>\n {(cite) => {\n const marker = () => cite() as { numbers: readonly number[]; raw: string }\n // The parser read this as a citation only while the host had sources;\n // if they have gone since, the marker is the text it was written as.\n // Match invokes this callback untracked; JSX keeps renderer and\n // same-count source replacements reactive without replacing the block.\n return (\n <>{props.citations ? props.citations.render(marker().numbers) : marker().raw}</>\n )\n }}\n </Match>\n </Switch>","<Match when={node().kind === 'text' && node()}>\n {(text) => <>{(text() as { text: string }).text}</>}\n </Match>","node().kind === 'text' && node()","{(text() as { text: string }).text}","<Match when={node().kind === 'code' && node()}>\n {(code) => <InlineCode>{(code() as { text: string }).text}</InlineCode>}\n </Match>","node().kind === 'code' && node()","<InlineCode>{(code() as { text: string }).text}</InlineCode>","<Match when={node().kind === 'strong' && node()}>\n {(strong) => (\n <strong class=\"font-semibold\">\n <Inline\n nodes={(strong() as { children: readonly MessageInline[] }).children}\n citations={props.citations}\n />\n </strong>\n )}\n </Match>","node().kind === 'strong' && node()","<Inline\n nodes={(strong() as { children: readonly MessageInline[] }).children}\n citations={props.citations}\n />","<Match when={node().kind === 'em' && node()}>\n {(em) => (\n <em>\n <Inline\n nodes={(em() as { children: readonly MessageInline[] }).children}\n citations={props.citations}\n />\n </em>\n )}\n </Match>","node().kind === 'em' && node()","<Inline\n nodes={(em() as { children: readonly MessageInline[] }).children}\n citations={props.citations}\n />","<Match when={node().kind === 'link' && node()}>\n {(link) => (\n <a\n href={(link() as { href: string }).href}\n target=\"_blank\"\n rel=\"noreferrer noopener\"\n class=\"text-primary underline underline-offset-2 hover:no-underline\"\n >\n <Inline nodes={(link() as { children: readonly MessageInline[] }).children} />\n </a>\n )}\n </Match>","node().kind === 'link' && node()","<Inline nodes={(link() as { children: readonly MessageInline[] }).children} />","<Match when={node().kind === 'cite' && node()}>\n {(cite) => {\n const marker = () => cite() as { numbers: readonly number[]; raw: string }\n // The parser read this as a citation only while the host had sources;\n // if they have gone since, the marker is the text it was written as.\n // Match invokes this callback untracked; JSX keeps renderer and\n // same-count source replacements reactive without replacing the block.\n return (\n <>{props.citations ? props.citations.render(marker().numbers) : marker().raw}</>\n )\n }}\n </Match>","node().kind === 'cite' && node()","{props.citations ? props.citations.render(marker().numbers) : marker().raw}"],"sources":["../../../../src/components/ui/message/message.tsx"],"sourcesContent":["import { createMemo, For, Match, Show, omit, Switch } from 'solid-js'\nimport { type ComponentProps, type JSX } from '@solidjs/web'\nimport { Check, Copy } from '@lucide/solid'\nimport { createCopyFeedback } from '#lib/clipboard'\nimport { cn } from '#lib/utils'\nimport { ActionButton, type ActionButtonProps } from '../../composites/action-button'\nimport { CodeBlock, InlineCode, type CodeBlockProps } from '../code-block'\nimport {\n parseMessageTextIncremental,\n type MessageBlock,\n type MessageInline,\n type MessageParse,\n} from './parse-message-text'\n\n/**\n * Message.\n *\n * One turn. The two speakers are laid out differently on purpose, and that is\n * the whole design:\n *\n * - **The person's turn is a bubble on the trailing edge** — short, bounded, and\n * easy to find when scrolling back through a long session.\n * - **The assistant's turn is the page.** It has no surface, spans the reading\n * column, and holds everything the agent did *for that request* — activity\n * (a `Trace`), prose, code, a pending decision — in one place, so a turn\n * reads as an answer with its working underneath it rather than as a chain of\n * unrelated cards.\n *\n * `label` is the turn's accessible name (\"You\", \"Assistant\"): the avatar and\n * name are not drawn for every turn, because a transcript that repeats a speaker\n * on every line is one nobody reads, but the name must still be announced.\n * `streaming` sets `aria-busy`, which tells assistive technology to wait for the\n * turn to settle before reading it instead of announcing every token.\n *\n * `anchorId` is the stable identity `MessageScroller` uses to keep the reader's\n * place when older turns are inserted above it.\n */\nexport type MessageRole = 'user' | 'assistant' | 'system'\n\nexport type MessageProps = Omit<ComponentProps<'article'>, 'role'> & {\n role: MessageRole\n label: string\n streaming?: boolean\n anchorId?: string\n}\n\nexport function Message(props: MessageProps) {\n const local = props\n const rest = omit(props, 'class', 'role', 'label', 'streaming', 'anchorId', 'children')\n return (\n <article\n data-slot=\"message\"\n data-role={local.role}\n data-anchor-id={local.anchorId}\n aria-label={local.label}\n aria-busy={local.streaming ? 'true' : undefined}\n class={cn(\n 'group/message mx-auto flex w-full max-w-3xl min-w-0 flex-col gap-2 py-2',\n // The engine may skip layout for turns far off screen; the intrinsic size\n // keeps the scrollbar honest while it does.\n '[content-visibility:auto] [contain-intrinsic-size:auto_6rem]',\n {\n 'items-end ps-[clamp(0rem,12%,4rem)]': local.role === 'user',\n 'items-stretch': local.role !== 'user',\n },\n local.class\n )}\n {...rest}\n >\n {local.children}\n </article>\n )\n}\n\n/** The speaker's mark and name, for the turns that draw one. */\nexport function MessageHeader(\n props: ComponentProps<'header'> & { avatar?: JSX.Element; time?: JSX.Element }\n) {\n const local = props\n const rest = omit(props, 'class', 'avatar', 'time', 'children')\n return (\n <header\n data-slot=\"message-header\"\n class={cn('flex items-center gap-2 text-xs text-muted-foreground', local.class)}\n {...rest}\n >\n <Show when={local.avatar}>{(avatarSlot) => <>{avatarSlot()}</>}</Show>\n <span class=\"font-medium text-foreground\">{local.children}</span>\n <Show when={local.time}>{(timeSlot) => <span class=\"tabular-nums\">{timeSlot()}</span>}</Show>\n </header>\n )\n}\n\n/** The turn's parts, stacked. Gap is the rhythm between prose, activity and code. */\nexport function MessageContent(props: ComponentProps<'div'>) {\n const local = props\n const rest = omit(props, 'class', 'children')\n return (\n <div\n data-slot=\"message-content\"\n class={cn(\n 'flex w-full max-w-3xl min-w-0 flex-col gap-3 font-content text-content',\n local.class\n )}\n {...rest}\n >\n {local.children}\n </div>\n )\n}\n\n/**\n * Actions that belong to the turn (copy, retry). Hidden until the turn is hovered\n * or focused so the column is not a wall of buttons, but never `display: none`:\n * a control that only exists under the pointer cannot be reached by keyboard,\n * and on a touch screen there is no hover, so coarse pointers always see them.\n */\nexport function MessageActions(props: ComponentProps<'div'>) {\n const local = props\n const rest = omit(props, 'class', 'children')\n return (\n <div\n data-slot=\"message-actions\"\n class={cn(\n 'flex items-center gap-1 opacity-0 transition-opacity ease-out group-focus-within/message:opacity-100 group-hover/message:opacity-100 [@media(hover:none)]:opacity-100',\n local.class\n )}\n {...rest}\n >\n {local.children}\n </div>\n )\n}\n\nexport type MessageActionProps = Omit<ActionButtonProps, 'tooltip' | 'aria-label'> & {\n /** The action's name: its accessible name and its tooltip. */\n label: string\n}\n\n/**\n * One action on a turn: an icon button whose name is also its tooltip, as in\n * AI Elements' MessageAction. Turn actions are icons, never words, so a row of\n * them stays one line under any message.\n */\nexport function MessageAction(props: MessageActionProps) {\n const local = props\n const rest = omit(props, 'label')\n return (\n <ActionButton\n type=\"button\"\n variant=\"ghost\"\n size=\"icon-xs\"\n data-slot=\"message-action\"\n aria-label={local.label}\n tooltip={local.label}\n tooltipSide=\"bottom\"\n {...(rest as ActionButtonProps)}\n />\n )\n}\n\n/** Copies the turn's text and shows a check for a moment once the clipboard took it. */\nexport function MessageCopyAction(\n props: Omit<MessageActionProps, 'label' | 'children' | 'onClick'> & {\n text: string | (() => string)\n label?: string\n }\n) {\n const local = props\n const rest = omit(props, 'text', 'label')\n const feedback = createCopyFeedback()\n const label = () =>\n feedback.copied() ? 'Copied' : feedback.failed() ? 'Copy failed' : (local.label ?? 'Copy')\n return (\n <MessageAction\n label={label()}\n onClick={() => {\n const text = typeof local.text === 'function' ? local.text() : local.text\n void feedback.copy(text)\n }}\n {...rest}\n >\n <Show when={feedback.copied()} fallback={<Copy />}>\n <Check />\n </Show>\n </MessageAction>\n )\n}\n\nexport function MessageFooter(props: ComponentProps<'footer'>) {\n const local = props\n const rest = omit(props, 'class', 'children')\n return (\n <footer\n data-slot=\"message-footer\"\n class={cn('flex min-w-0 items-center gap-2 text-xs text-muted-foreground', local.class)}\n {...rest}\n >\n {local.children}\n </footer>\n )\n}\n\n/** The props of a fenced block the host may set. */\nexport type MessageCodeBlockProps = Pick<\n CodeBlockProps,\n 'loadHighlight' | 'maxHeight' | 'wrap' | 'showLineNumbers' | 'lineMarks' | 'lineLimit'\n>\n\n/** What the host is told about a fenced block when it chooses that block's props. */\nexport type MessageCodeBlockInfo = Readonly<{\n /** Position among the text's fenced blocks, from 0. */\n index: number\n language: string | undefined\n code: string\n complete: boolean\n}>\n\n/**\n * How `MessageText` draws citation markers. `count` is how many sources the host\n * has; a `[^n]` marker is a citation only when every `n` is within it. `render`\n * receives the 1-based source numbers and draws the marker, so the host decides\n * what a number means (`messageCitations` in the inline-citation composite does\n * this for a `Source` list).\n */\nexport type MessageCitations = Readonly<{\n count: number\n render: (numbers: readonly number[]) => JSX.Element\n}>\n\nexport type MessageTextProps = Omit<ComponentProps<'div'>, 'children'> & {\n text: string\n /** True while text may still arrive: a trailing open fence renders as partial code. */\n streaming?: boolean\n /**\n * Forwarded to each fenced block, e.g. to supply a lazy highlighter. A function\n * chooses per block, which is how line marks reach a block: marks belong to the\n * host's knowledge of the code (a diff, a failing line), never to the text.\n */\n codeBlockProps?: MessageCodeBlockProps | ((block: MessageCodeBlockInfo) => MessageCodeBlockProps)\n /** Without it, `[^1]` stays the literal text it was written as. */\n citations?: MessageCitations\n}\n\nfunction sameBlock(a: MessageBlock | undefined, b: MessageBlock): boolean {\n return (\n a !== undefined &&\n a.kind === b.kind &&\n a.raw === b.raw &&\n (a.kind !== 'code' || (b.kind === 'code' && a.complete === b.complete))\n )\n}\n\n/**\n * Text, read safely.\n *\n * Renders `parseMessageText`'s blocks as elements: nothing is interpreted as\n * HTML and a link only becomes an anchor when its scheme is http, https or\n * mailto. Blocks are kept by *position* and reuse their previous parsed object\n * when unchanged, so a streaming turn updates the block that is growing and\n * leaves every earlier paragraph and code block — and any selection or focus\n * inside them — untouched.\n */\nexport function MessageText(props: MessageTextProps) {\n const local = props\n const rest = omit(props, 'class', 'text', 'streaming', 'codeBlockProps', 'citations')\n let previous: readonly MessageBlock[] = []\n let previousCount = 0\n let parsed: MessageParse | undefined\n // Only the number of sources reaches the parser, so a new `render` function\n // does not reparse the text, and a changed count does.\n const citationCount = () => local.citations?.count ?? 0\n const blocks = createMemo(() => {\n const count = citationCount()\n if (count !== previousCount) previous = []\n previousCount = count\n // A streamed reply only grows, so each delta parses the tail it touched\n // rather than the whole reply (which made a long reply quadratic).\n parsed = parseMessageTextIncremental(parsed, local.text, {\n streaming: local.streaming,\n citations: count || undefined,\n })\n const next = parsed.blocks\n const merged = next.map((block, index) =>\n sameBlock(previous[index], block) ? previous[index]! : block\n )\n previous = merged\n return merged\n })\n // The nth fenced block, so a host can address it. Blocks keep their positions\n // while text streams in after them, so an index stays attached to its block.\n const codeIndexes = createMemo(() => {\n let next = 0\n return blocks().map((block) => (block.kind === 'code' ? next++ : -1))\n })\n const lastIsProse = () => {\n const last = blocks().at(-1)\n return last !== undefined && last.kind !== 'code'\n }\n return (\n <div data-slot=\"message-text\" class={cn('flex min-w-0 flex-col gap-3', local.class)} {...rest}>\n <For keyed={false} each={blocks()}>\n {(block, index) => (\n <BlockView\n block={block()}\n codeProps={local.codeBlockProps}\n codeIndex={() => codeIndexes()[index] ?? 0}\n citations={local.citations}\n />\n )}\n </For>\n <Show when={local.streaming && lastIsProse()}>\n <span class=\"streaming-caret\" aria-hidden=\"true\" />\n </Show>\n </div>\n )\n}\n\nfunction BlockView(props: {\n block: MessageBlock\n codeProps?: MessageTextProps['codeBlockProps']\n codeIndex: () => number\n citations?: MessageCitations\n}) {\n return (\n <Switch>\n <Match when={props.block.kind === 'code' && props.block}>\n {(block) => {\n const code = () => block() as Extract<MessageBlock, { kind: 'code' }>\n const chosen = () => {\n const choice = props.codeProps\n return typeof choice === 'function'\n ? choice({\n index: props.codeIndex(),\n language: code().language,\n code: code().code,\n complete: code().complete,\n })\n : choice\n }\n return (\n <CodeBlock\n code={code().code}\n language={code().language}\n complete={code().complete}\n {...chosen()}\n />\n )\n }}\n </Match>\n <Match when={props.block.kind === 'heading' && props.block}>\n {(block) => {\n const heading = () => block() as Extract<MessageBlock, { kind: 'heading' }>\n return (\n <p\n role=\"heading\"\n aria-level={heading().level + 2}\n class=\"font-semibold text-foreground [overflow-wrap:anywhere]\"\n >\n <Inline nodes={heading().inline} citations={props.citations} />\n </p>\n )\n }}\n </Match>\n <Match when={props.block.kind === 'list' && props.block}>\n {(block) => {\n const list = () => block() as Extract<MessageBlock, { kind: 'list' }>\n return (\n <Show\n when={list().ordered}\n fallback={\n <ul class=\"m-0 ms-5 flex list-disc flex-col gap-1 p-0 marker:text-muted-foreground\">\n <For each={list().items}>\n {(item) => (\n <li class=\"[overflow-wrap:anywhere]\">\n <Inline nodes={item} citations={props.citations} />\n </li>\n )}\n </For>\n </ul>\n }\n >\n <ol\n start={list().start}\n class=\"m-0 ms-5 flex list-decimal flex-col gap-1 p-0 marker:text-muted-foreground\"\n >\n <For each={list().items}>\n {(item) => (\n <li class=\"[overflow-wrap:anywhere]\">\n <Inline nodes={item} citations={props.citations} />\n </li>\n )}\n </For>\n </ol>\n </Show>\n )\n }}\n </Match>\n <Match when={props.block.kind === 'quote' && props.block}>\n {(block) => {\n const quote = () => block() as Extract<MessageBlock, { kind: 'quote' }>\n return (\n <blockquote class=\"m-0 border-s-2 border-border ps-3 whitespace-pre-wrap text-muted-foreground [overflow-wrap:anywhere]\">\n <Inline nodes={quote().inline} citations={props.citations} />\n </blockquote>\n )\n }}\n </Match>\n <Match when={props.block.kind === 'paragraph' && props.block}>\n {(block) => {\n const paragraph = () => block() as Extract<MessageBlock, { kind: 'paragraph' }>\n return (\n <p class=\"m-0 whitespace-pre-wrap [overflow-wrap:anywhere]\">\n <Inline nodes={paragraph().inline} citations={props.citations} />\n </p>\n )\n }}\n </Match>\n </Switch>\n )\n}\n\nfunction Inline(props: { nodes: readonly MessageInline[]; citations?: MessageCitations }) {\n // By position, not identity: the parser returns fresh nodes for the growing\n // paragraph on every streamed token, and a keyed list would rebuild each one.\n return (\n <For keyed={false} each={props.nodes}>\n {(node) => (\n <Switch>\n {/* Fragments keep the reads reactive: Match runs its callback untracked. */}\n <Match when={node().kind === 'text' && node()}>\n {(text) => <>{(text() as { text: string }).text}</>}\n </Match>\n <Match when={node().kind === 'code' && node()}>\n {(code) => <InlineCode>{(code() as { text: string }).text}</InlineCode>}\n </Match>\n <Match when={node().kind === 'strong' && node()}>\n {(strong) => (\n <strong class=\"font-semibold\">\n <Inline\n nodes={(strong() as { children: readonly MessageInline[] }).children}\n citations={props.citations}\n />\n </strong>\n )}\n </Match>\n <Match when={node().kind === 'em' && node()}>\n {(em) => (\n <em>\n <Inline\n nodes={(em() as { children: readonly MessageInline[] }).children}\n citations={props.citations}\n />\n </em>\n )}\n </Match>\n <Match when={node().kind === 'link' && node()}>\n {(link) => (\n <a\n href={(link() as { href: string }).href}\n target=\"_blank\"\n rel=\"noreferrer noopener\"\n class=\"text-primary underline underline-offset-2 hover:no-underline\"\n >\n <Inline nodes={(link() as { children: readonly MessageInline[] }).children} />\n </a>\n )}\n </Match>\n <Match when={node().kind === 'cite' && node()}>\n {(cite) => {\n const marker = () => cite() as { numbers: readonly number[]; raw: string }\n // The parser read this as a citation only while the host had sources;\n // if they have gone since, the marker is the text it was written as.\n // Match invokes this callback untracked; JSX keeps renderer and\n // same-count source replacements reactive without replacing the block.\n return (\n <>{props.citations ? props.citations.render(marker().numbers) : marker().raw}</>\n )\n }}\n </Match>\n </Switch>\n )}\n </For>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AA8CA,SAAgB,QAAQ,OAAqB;CAC3C,MAAM,QAAQ;CACd,MAAM,OAAO,KAAK,OAAO,SAAS,QAAQ,SAAS,aAAa,YAAY,UAAU;CAEpF,IAAA,OAAA,OAoBS;CAHP,OAAA,MAAA,CAAA;EAhBA,aAAA;EACA,IAAA,cAAA;GAAW,OAAA,MAAM;EAAI;EACrB,IAAA,mBAAA;GAAgB,OAAA,MAAM;EAAQ;EAC9B,IAAA,eAAA;GAAY,OAAA,MAAM;EAAK;EACvB,IAAA,cAAA;GAAW,OAAA,MAAM,YAAY,SAAS,KAAA;EAAS;EAC/C,IAAA,UAAA;GAAO,OAAA,GACL,2EAGA,gEACA;IACE,uCAAuC,MAAM,SAAS;IACtD,iBAAiB,MAAM,SAAS;GAClC,GACA,MAAM,KACR;EAAC;CACO,GAAJ,IAAA,GAAA,IAAA;CAjBN,OAAA,YAmBE;EAAC,OAAA,MAAM;CAAQ,CACR;CArBX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YAAA;QAAW,OAAA,MAAM;OAAS;MAC3B,CAAA,CACC;MALJ,OAAA;KAKI,EAAA,CAAA;IAED,CAAA;IACPC,gBAAAA,OAAAA;KAAO,IAAA,OAAA;MAAMC,OAAAA,WAAAA;OAAK,OAAA,KAAA,CAAC,CAAC,SAAS;MAAe,CAAA,CAAC,CAAD,KAAL,KAAK;KAAC;KAA7CD,WACI,gBACA;MAOG,IAAA,SAAA,SAAA;;MAPH,OAAA,QAMEE,gBAAAA,QAAAA,EAAQ,IAAA,QAAA;OAAQ,OAAA,KAAK,CAAA,CAA6C;MAAQ,EAAG,CAAA,CAC5E;MAND,aAAO,KAAK,CAAA,CAAuB,OAAnC,QAAA;OAAuC,aAAA,QAAA,QAAA,GAAA;;;MADzC,OAAA;KAOG,EAAA,CAAA;IAEA,CAAA;IACPC,gBAAAA,OAAAA;KAAO,IAAA,OAAA;MAAMC,OAAAA,WAAAA;OAAK,OAAA,KAAA,CAAC,CAAC,SAAS;MAAe,CAAA,CAAC,CAAD,KAAL,KAAK;KAAC;KAA7CD,WACI,SAAS;MACT,MAAM,eAAe,KAAK;MAK1B,OACIE,WAAAA;;QAAC,OAAA,CAAA,CAAA,MAAM;OAAmE,CAAA,CAAC,CAAD,IAAvD,MAAM,UAAU,OAAO,OAAO,CAAC,CAAC,OAAO,IAAI,OAAO,CAAC,CAAC;MAAG,CAAA;KAEhF;IACK,CAAA;GAlDR;EAmDO,EAAA,CAAA;CAEP,CAAA;AAET"}
1
+ {"version":3,"file":"message.js","names":["<article\n data-slot=\"message\"\n data-role={local.role}\n data-anchor-id={local.anchorId}\n aria-label={local.label}\n aria-busy={local.streaming ? 'true' : undefined}\n class={cn(\n 'group/message mx-auto flex w-full max-w-3xl min-w-0 flex-col gap-2 py-2',\n // The engine may skip layout for turns far off screen; the intrinsic size\n // keeps the scrollbar honest while it does.\n '[content-visibility:auto] [contain-intrinsic-size:auto_6rem]',\n {\n 'items-end ps-[clamp(0rem,12%,4rem)]': local.role === 'user',\n 'items-stretch': local.role !== 'user',\n },\n local.class\n )}\n {...rest}\n >\n {local.children}\n </article>","<Show when={local.avatar}>{(avatarSlot) => <>{avatarSlot()}</>}</Show>","{avatarSlot()}","<header\n data-slot=\"message-header\"\n class={cn('flex items-center gap-2 text-xs text-muted-foreground', local.class)}\n {...rest}\n >\n <Show when={local.avatar}>{(avatarSlot) => <>{avatarSlot()}</>}</Show>\n <span class=\"font-medium text-foreground\">{local.children}</span>\n <Show when={local.time}>{(timeSlot) => <span class=\"tabular-nums\">{timeSlot()}</span>}</Show>\n </header>","<Show when={local.time}>{(timeSlot) => <span class=\"tabular-nums\">{timeSlot()}</span>}</Show>","<div\n data-slot=\"message-content\"\n class={cn(\n 'flex w-full max-w-3xl min-w-0 flex-col gap-3 font-content text-content',\n local.class\n )}\n {...rest}\n >\n {local.children}\n </div>","<div\n data-slot=\"message-actions\"\n class={cn(\n 'flex items-center gap-1 opacity-0 transition-opacity ease-out group-focus-within/message:opacity-100 group-hover/message:opacity-100 [@media(hover:none)]:opacity-100',\n local.class\n )}\n {...rest}\n >\n {local.children}\n </div>","<ActionButton\n type=\"button\"\n variant=\"ghost\"\n size=\"icon-xs\"\n data-slot=\"message-action\"\n aria-label={local.label}\n tooltip={local.label}\n tooltipSide=\"bottom\"\n {...(rest as ActionButtonProps)}\n />","type=\"button\"","variant=\"ghost\"","size=\"icon-xs\"","tooltipSide=\"bottom\"","<MessageAction\n label={label()}\n onClick={() => {\n const text = typeof local.text === 'function' ? local.text() : local.text\n void feedback.copy(text)\n }}\n {...rest}\n >\n <Show when={feedback.copied()} fallback={<Copy />}>\n <Check />\n </Show>\n </MessageAction>","onClick={() => {\n const text = typeof local.text === 'function' ? local.text() : local.text\n void feedback.copy(text)\n }}","<Show when={feedback.copied()} fallback={<Copy />}>\n <Check />\n </Show>","<Check />","<Copy />","<footer\n data-slot=\"message-footer\"\n class={cn('flex min-w-0 items-center gap-2 text-xs text-muted-foreground', local.class)}\n {...rest}\n >\n {local.children}\n </footer>","<For keyed={false} each={blocks()}>\n {(block, index) => (\n <BlockView\n block={block()}\n codeProps={local.codeBlockProps}\n codeIndex={() => codeIndexes()[index] ?? 0}\n citations={local.citations}\n />\n )}\n </For>","keyed={false}","<BlockView\n block={block()}\n codeProps={local.codeBlockProps}\n codeIndex={() => codeIndexes()[index] ?? 0}\n citations={local.citations}\n />","codeIndex={() => codeIndexes()[index] ?? 0}","<div data-slot=\"message-text\" class={cn('flex min-w-0 flex-col gap-3', local.class)} {...rest}>\n <For keyed={false} each={blocks()}>\n {(block, index) => (\n <BlockView\n block={block()}\n codeProps={local.codeBlockProps}\n codeIndex={() => codeIndexes()[index] ?? 0}\n citations={local.citations}\n />\n )}\n </For>\n <Show when={local.streaming && lastIsProse()}>\n <span class=\"streaming-caret\" aria-hidden=\"true\" />\n </Show>\n </div>","<span class=\"streaming-caret\" aria-hidden=\"true\" />","<Switch>\n <Match when={props.block.kind === 'code' && props.block}>\n {(block) => {\n const code = () => block() as Extract<MessageBlock, { kind: 'code' }>\n const chosen = () => {\n const choice = props.codeProps\n return typeof choice === 'function'\n ? choice({\n index: props.codeIndex(),\n language: code().language,\n code: code().code,\n complete: code().complete,\n })\n : choice\n }\n return (\n <CodeBlock\n code={code().code}\n language={code().language}\n complete={code().complete}\n {...chosen()}\n />\n )\n }}\n </Match>\n <Match when={props.block.kind === 'heading' && props.block}>\n {(block) => {\n const heading = () => block() as Extract<MessageBlock, { kind: 'heading' }>\n return (\n <p\n role=\"heading\"\n aria-level={heading().level + 2}\n class=\"font-semibold text-foreground [overflow-wrap:anywhere]\"\n >\n <Inline nodes={heading().inline} citations={props.citations} />\n </p>\n )\n }}\n </Match>\n <Match when={props.block.kind === 'list' && props.block}>\n {(block) => {\n const list = () => block() as Extract<MessageBlock, { kind: 'list' }>\n return (\n <Show\n when={list().ordered}\n fallback={\n <ul class=\"m-0 ms-5 flex list-disc flex-col gap-1 p-0 marker:text-muted-foreground\">\n <For each={list().items}>\n {(item) => (\n <li class=\"[overflow-wrap:anywhere]\">\n <Inline nodes={item} citations={props.citations} />\n </li>\n )}\n </For>\n </ul>\n }\n >\n <ol\n start={list().start}\n class=\"m-0 ms-5 flex list-decimal flex-col gap-1 p-0 marker:text-muted-foreground\"\n >\n <For each={list().items}>\n {(item) => (\n <li class=\"[overflow-wrap:anywhere]\">\n <Inline nodes={item} citations={props.citations} />\n </li>\n )}\n </For>\n </ol>\n </Show>\n )\n }}\n </Match>\n <Match when={props.block.kind === 'quote' && props.block}>\n {(block) => {\n const quote = () => block() as Extract<MessageBlock, { kind: 'quote' }>\n return (\n <blockquote class=\"m-0 border-s-2 border-border ps-3 whitespace-pre-wrap text-muted-foreground [overflow-wrap:anywhere]\">\n <Inline nodes={quote().inline} citations={props.citations} />\n </blockquote>\n )\n }}\n </Match>\n <Match when={props.block.kind === 'paragraph' && props.block}>\n {(block) => {\n const paragraph = () => block() as Extract<MessageBlock, { kind: 'paragraph' }>\n return (\n <p class=\"m-0 whitespace-pre-wrap [overflow-wrap:anywhere]\">\n <Inline nodes={paragraph().inline} citations={props.citations} />\n </p>\n )\n }}\n </Match>\n </Switch>","<Match when={props.block.kind === 'code' && props.block}>\n {(block) => {\n const code = () => block() as Extract<MessageBlock, { kind: 'code' }>\n const chosen = () => {\n const choice = props.codeProps\n return typeof choice === 'function'\n ? choice({\n index: props.codeIndex(),\n language: code().language,\n code: code().code,\n complete: code().complete,\n })\n : choice\n }\n return (\n <CodeBlock\n code={code().code}\n language={code().language}\n complete={code().complete}\n {...chosen()}\n />\n )\n }}\n </Match>","props.block.kind === 'code' && props.block","<CodeBlock\n code={code().code}\n language={code().language}\n complete={code().complete}\n {...chosen()}\n />","<Match when={props.block.kind === 'heading' && props.block}>\n {(block) => {\n const heading = () => block() as Extract<MessageBlock, { kind: 'heading' }>\n return (\n <p\n role=\"heading\"\n aria-level={heading().level + 2}\n class=\"font-semibold text-foreground [overflow-wrap:anywhere]\"\n >\n <Inline nodes={heading().inline} citations={props.citations} />\n </p>\n )\n }}\n </Match>","props.block.kind === 'heading' && props.block","<Inline nodes={heading().inline} citations={props.citations} />","<p\n role=\"heading\"\n aria-level={heading().level + 2}\n class=\"font-semibold text-foreground [overflow-wrap:anywhere]\"\n >\n <Inline nodes={heading().inline} citations={props.citations} />\n </p>","<Match when={props.block.kind === 'list' && props.block}>\n {(block) => {\n const list = () => block() as Extract<MessageBlock, { kind: 'list' }>\n return (\n <Show\n when={list().ordered}\n fallback={\n <ul class=\"m-0 ms-5 flex list-disc flex-col gap-1 p-0 marker:text-muted-foreground\">\n <For each={list().items}>\n {(item) => (\n <li class=\"[overflow-wrap:anywhere]\">\n <Inline nodes={item} citations={props.citations} />\n </li>\n )}\n </For>\n </ul>\n }\n >\n <ol\n start={list().start}\n class=\"m-0 ms-5 flex list-decimal flex-col gap-1 p-0 marker:text-muted-foreground\"\n >\n <For each={list().items}>\n {(item) => (\n <li class=\"[overflow-wrap:anywhere]\">\n <Inline nodes={item} citations={props.citations} />\n </li>\n )}\n </For>\n </ol>\n </Show>\n )\n }}\n </Match>","props.block.kind === 'list' && props.block","<Show\n when={list().ordered}\n fallback={\n <ul class=\"m-0 ms-5 flex list-disc flex-col gap-1 p-0 marker:text-muted-foreground\">\n <For each={list().items}>\n {(item) => (\n <li class=\"[overflow-wrap:anywhere]\">\n <Inline nodes={item} citations={props.citations} />\n </li>\n )}\n </For>\n </ul>\n }\n >\n <ol\n start={list().start}\n class=\"m-0 ms-5 flex list-decimal flex-col gap-1 p-0 marker:text-muted-foreground\"\n >\n <For each={list().items}>\n {(item) => (\n <li class=\"[overflow-wrap:anywhere]\">\n <Inline nodes={item} citations={props.citations} />\n </li>\n )}\n </For>\n </ol>\n </Show>","<For each={list().items}>\n {(item) => (\n <li class=\"[overflow-wrap:anywhere]\">\n <Inline nodes={item} citations={props.citations} />\n </li>\n )}\n </For>","<Inline nodes={item} citations={props.citations} />","nodes={item}","<For each={list().items}>\n {(item) => (\n <li class=\"[overflow-wrap:anywhere]\">\n <Inline nodes={item} citations={props.citations} />\n </li>\n )}\n </For>","<Match when={props.block.kind === 'quote' && props.block}>\n {(block) => {\n const quote = () => block() as Extract<MessageBlock, { kind: 'quote' }>\n return (\n <blockquote class=\"m-0 border-s-2 border-border ps-3 whitespace-pre-wrap text-muted-foreground [overflow-wrap:anywhere]\">\n <Inline nodes={quote().inline} citations={props.citations} />\n </blockquote>\n )\n }}\n </Match>","props.block.kind === 'quote' && props.block","<Inline nodes={quote().inline} citations={props.citations} />","<blockquote class=\"m-0 border-s-2 border-border ps-3 whitespace-pre-wrap text-muted-foreground [overflow-wrap:anywhere]\">\n <Inline nodes={quote().inline} citations={props.citations} />\n </blockquote>","<Match when={props.block.kind === 'paragraph' && props.block}>\n {(block) => {\n const paragraph = () => block() as Extract<MessageBlock, { kind: 'paragraph' }>\n return (\n <p class=\"m-0 whitespace-pre-wrap [overflow-wrap:anywhere]\">\n <Inline nodes={paragraph().inline} citations={props.citations} />\n </p>\n )\n }}\n </Match>","props.block.kind === 'paragraph' && props.block","<Inline nodes={paragraph().inline} citations={props.citations} />","<p class=\"m-0 whitespace-pre-wrap [overflow-wrap:anywhere]\">\n <Inline nodes={paragraph().inline} citations={props.citations} />\n </p>","<For keyed={false} each={props.nodes}>\n {(node) => (\n <Switch>\n {/* Fragments keep the reads reactive: Match runs its callback untracked. */}\n <Match when={node().kind === 'text' && node()}>\n {(text) => <>{(text() as { text: string }).text}</>}\n </Match>\n <Match when={node().kind === 'code' && node()}>\n {(code) => <InlineCode>{(code() as { text: string }).text}</InlineCode>}\n </Match>\n <Match when={node().kind === 'strong' && node()}>\n {(strong) => (\n <strong class=\"font-semibold\">\n <Inline\n nodes={(strong() as { children: readonly MessageInline[] }).children}\n citations={props.citations}\n />\n </strong>\n )}\n </Match>\n <Match when={node().kind === 'em' && node()}>\n {(em) => (\n <em>\n <Inline\n nodes={(em() as { children: readonly MessageInline[] }).children}\n citations={props.citations}\n />\n </em>\n )}\n </Match>\n <Match when={node().kind === 'link' && node()}>\n {(link) => (\n <a\n href={(link() as { href: string }).href}\n target=\"_blank\"\n rel=\"noreferrer noopener\"\n class=\"text-primary underline underline-offset-2 hover:no-underline\"\n >\n <Inline nodes={(link() as { children: readonly MessageInline[] }).children} />\n </a>\n )}\n </Match>\n <Match when={node().kind === 'cite' && node()}>\n {(cite) => {\n const marker = () => cite() as { numbers: readonly number[]; raw: string }\n // The parser read this as a citation only while the host had sources;\n // if they have gone since, the marker is the text it was written as.\n // Match invokes this callback untracked; JSX keeps renderer and\n // same-count source replacements reactive without replacing the block.\n return (\n <>{props.citations ? props.citations.render(marker().numbers) : marker().raw}</>\n )\n }}\n </Match>\n </Switch>\n )}\n </For>","<Switch>\n {/* Fragments keep the reads reactive: Match runs its callback untracked. */}\n <Match when={node().kind === 'text' && node()}>\n {(text) => <>{(text() as { text: string }).text}</>}\n </Match>\n <Match when={node().kind === 'code' && node()}>\n {(code) => <InlineCode>{(code() as { text: string }).text}</InlineCode>}\n </Match>\n <Match when={node().kind === 'strong' && node()}>\n {(strong) => (\n <strong class=\"font-semibold\">\n <Inline\n nodes={(strong() as { children: readonly MessageInline[] }).children}\n citations={props.citations}\n />\n </strong>\n )}\n </Match>\n <Match when={node().kind === 'em' && node()}>\n {(em) => (\n <em>\n <Inline\n nodes={(em() as { children: readonly MessageInline[] }).children}\n citations={props.citations}\n />\n </em>\n )}\n </Match>\n <Match when={node().kind === 'link' && node()}>\n {(link) => (\n <a\n href={(link() as { href: string }).href}\n target=\"_blank\"\n rel=\"noreferrer noopener\"\n class=\"text-primary underline underline-offset-2 hover:no-underline\"\n >\n <Inline nodes={(link() as { children: readonly MessageInline[] }).children} />\n </a>\n )}\n </Match>\n <Match when={node().kind === 'cite' && node()}>\n {(cite) => {\n const marker = () => cite() as { numbers: readonly number[]; raw: string }\n // The parser read this as a citation only while the host had sources;\n // if they have gone since, the marker is the text it was written as.\n // Match invokes this callback untracked; JSX keeps renderer and\n // same-count source replacements reactive without replacing the block.\n return (\n <>{props.citations ? props.citations.render(marker().numbers) : marker().raw}</>\n )\n }}\n </Match>\n </Switch>","<Match when={node().kind === 'text' && node()}>\n {(text) => <>{(text() as { text: string }).text}</>}\n </Match>","node().kind === 'text' && node()","{(text() as { text: string }).text}","<Match when={node().kind === 'code' && node()}>\n {(code) => <InlineCode>{(code() as { text: string }).text}</InlineCode>}\n </Match>","node().kind === 'code' && node()","<InlineCode>{(code() as { text: string }).text}</InlineCode>","<Match when={node().kind === 'strong' && node()}>\n {(strong) => (\n <strong class=\"font-semibold\">\n <Inline\n nodes={(strong() as { children: readonly MessageInline[] }).children}\n citations={props.citations}\n />\n </strong>\n )}\n </Match>","node().kind === 'strong' && node()","<Inline\n nodes={(strong() as { children: readonly MessageInline[] }).children}\n citations={props.citations}\n />","<Match when={node().kind === 'em' && node()}>\n {(em) => (\n <em>\n <Inline\n nodes={(em() as { children: readonly MessageInline[] }).children}\n citations={props.citations}\n />\n </em>\n )}\n </Match>","node().kind === 'em' && node()","<Inline\n nodes={(em() as { children: readonly MessageInline[] }).children}\n citations={props.citations}\n />","<Match when={node().kind === 'link' && node()}>\n {(link) => (\n <a\n href={(link() as { href: string }).href}\n target=\"_blank\"\n rel=\"noreferrer noopener\"\n class=\"text-primary underline underline-offset-2 hover:no-underline\"\n >\n <Inline nodes={(link() as { children: readonly MessageInline[] }).children} />\n </a>\n )}\n </Match>","node().kind === 'link' && node()","<Inline nodes={(link() as { children: readonly MessageInline[] }).children} />","<Match when={node().kind === 'cite' && node()}>\n {(cite) => {\n const marker = () => cite() as { numbers: readonly number[]; raw: string }\n // The parser read this as a citation only while the host had sources;\n // if they have gone since, the marker is the text it was written as.\n // Match invokes this callback untracked; JSX keeps renderer and\n // same-count source replacements reactive without replacing the block.\n return (\n <>{props.citations ? props.citations.render(marker().numbers) : marker().raw}</>\n )\n }}\n </Match>","node().kind === 'cite' && node()","{props.citations ? props.citations.render(marker().numbers) : marker().raw}","_$spread","_$insert","_$effect","_$setAttribute"],"sources":["../../../../src/components/ui/message/message.tsx"],"sourcesContent":["import { createMemo, For, Match, Show, omit, Switch } from 'solid-js'\nimport { type ComponentProps, type JSX } from '@solidjs/web'\nimport { Check, Copy } from '@lucide/solid'\nimport { createCopyFeedback } from '#lib/clipboard'\nimport { cn } from '#lib/utils'\nimport { ActionButton, type ActionButtonProps } from '../../composites/action-button'\nimport { CodeBlock, InlineCode, type CodeBlockProps } from '../code-block'\nimport {\n parseMessageTextIncremental,\n type MessageBlock,\n type MessageInline,\n type MessageParse,\n} from './parse-message-text'\n\n/**\n * Message.\n *\n * One turn. The two speakers are laid out differently on purpose, and that is\n * the whole design:\n *\n * - **The person's turn is a bubble on the trailing edge** — short, bounded, and\n * easy to find when scrolling back through a long session.\n * - **The assistant's turn is the page.** It has no surface, spans the reading\n * column, and holds everything the agent did *for that request* — activity\n * (a `Trace`), prose, code, a pending decision — in one place, so a turn\n * reads as an answer with its working underneath it rather than as a chain of\n * unrelated cards.\n *\n * `label` is the turn's accessible name (\"You\", \"Assistant\"): the avatar and\n * name are not drawn for every turn, because a transcript that repeats a speaker\n * on every line is one nobody reads, but the name must still be announced.\n * `streaming` sets `aria-busy`, which tells assistive technology to wait for the\n * turn to settle before reading it instead of announcing every token.\n *\n * `anchorId` is the stable identity `MessageScroller` uses to keep the reader's\n * place when older turns are inserted above it.\n */\nexport type MessageRole = 'user' | 'assistant' | 'system'\n\nexport type MessageProps = Omit<ComponentProps<'article'>, 'role'> & {\n role: MessageRole\n label: string\n streaming?: boolean\n anchorId?: string\n}\n\nexport function Message(props: MessageProps) {\n const local = props\n const rest = omit(props, 'class', 'role', 'label', 'streaming', 'anchorId', 'children')\n return (\n <article\n data-slot=\"message\"\n data-role={local.role}\n data-anchor-id={local.anchorId}\n aria-label={local.label}\n aria-busy={local.streaming ? 'true' : undefined}\n class={cn(\n 'group/message mx-auto flex w-full max-w-3xl min-w-0 flex-col gap-2 py-2',\n // The engine may skip layout for turns far off screen; the intrinsic size\n // keeps the scrollbar honest while it does.\n '[content-visibility:auto] [contain-intrinsic-size:auto_6rem]',\n {\n 'items-end ps-[clamp(0rem,12%,4rem)]': local.role === 'user',\n 'items-stretch': local.role !== 'user',\n },\n local.class\n )}\n {...rest}\n >\n {local.children}\n </article>\n )\n}\n\n/** The speaker's mark and name, for the turns that draw one. */\nexport function MessageHeader(\n props: ComponentProps<'header'> & { avatar?: JSX.Element; time?: JSX.Element }\n) {\n const local = props\n const rest = omit(props, 'class', 'avatar', 'time', 'children')\n return (\n <header\n data-slot=\"message-header\"\n class={cn('flex items-center gap-2 text-xs text-muted-foreground', local.class)}\n {...rest}\n >\n <Show when={local.avatar}>{(avatarSlot) => <>{avatarSlot()}</>}</Show>\n <span class=\"font-medium text-foreground\">{local.children}</span>\n <Show when={local.time}>{(timeSlot) => <span class=\"tabular-nums\">{timeSlot()}</span>}</Show>\n </header>\n )\n}\n\n/** The turn's parts, stacked. Gap is the rhythm between prose, activity and code. */\nexport function MessageContent(props: ComponentProps<'div'>) {\n const local = props\n const rest = omit(props, 'class', 'children')\n return (\n <div\n data-slot=\"message-content\"\n class={cn(\n 'flex w-full max-w-3xl min-w-0 flex-col gap-3 font-content text-content',\n local.class\n )}\n {...rest}\n >\n {local.children}\n </div>\n )\n}\n\n/**\n * Actions that belong to the turn (copy, retry). Hidden until the turn is hovered\n * or focused so the column is not a wall of buttons, but never `display: none`:\n * a control that only exists under the pointer cannot be reached by keyboard,\n * and on a touch screen there is no hover, so coarse pointers always see them.\n */\nexport function MessageActions(props: ComponentProps<'div'>) {\n const local = props\n const rest = omit(props, 'class', 'children')\n return (\n <div\n data-slot=\"message-actions\"\n class={cn(\n 'flex items-center gap-1 opacity-0 transition-opacity ease-out group-focus-within/message:opacity-100 group-hover/message:opacity-100 [@media(hover:none)]:opacity-100',\n local.class\n )}\n {...rest}\n >\n {local.children}\n </div>\n )\n}\n\nexport type MessageActionProps = Omit<ActionButtonProps, 'tooltip' | 'aria-label'> & {\n /** The action's name: its accessible name and its tooltip. */\n label: string\n}\n\n/**\n * One action on a turn: an icon button whose name is also its tooltip, as in\n * AI Elements' MessageAction. Turn actions are icons, never words, so a row of\n * them stays one line under any message.\n */\nexport function MessageAction(props: MessageActionProps) {\n const local = props\n const rest = omit(props, 'label')\n return (\n <ActionButton\n type=\"button\"\n variant=\"ghost\"\n size=\"icon-xs\"\n data-slot=\"message-action\"\n aria-label={local.label}\n tooltip={local.label}\n tooltipSide=\"bottom\"\n {...(rest as ActionButtonProps)}\n />\n )\n}\n\n/** Copies the turn's text and shows a check for a moment once the clipboard took it. */\nexport function MessageCopyAction(\n props: Omit<MessageActionProps, 'label' | 'children' | 'onClick'> & {\n text: string | (() => string)\n label?: string\n }\n) {\n const local = props\n const rest = omit(props, 'text', 'label')\n const feedback = createCopyFeedback()\n const label = () =>\n feedback.copied() ? 'Copied' : feedback.failed() ? 'Copy failed' : (local.label ?? 'Copy')\n return (\n <MessageAction\n label={label()}\n onClick={() => {\n const text = typeof local.text === 'function' ? local.text() : local.text\n void feedback.copy(text)\n }}\n {...rest}\n >\n <Show when={feedback.copied()} fallback={<Copy />}>\n <Check />\n </Show>\n </MessageAction>\n )\n}\n\nexport function MessageFooter(props: ComponentProps<'footer'>) {\n const local = props\n const rest = omit(props, 'class', 'children')\n return (\n <footer\n data-slot=\"message-footer\"\n class={cn('flex min-w-0 items-center gap-2 text-xs text-muted-foreground', local.class)}\n {...rest}\n >\n {local.children}\n </footer>\n )\n}\n\n/** The props of a fenced block the host may set. */\nexport type MessageCodeBlockProps = Pick<\n CodeBlockProps,\n 'loadHighlight' | 'maxHeight' | 'wrap' | 'showLineNumbers' | 'lineMarks' | 'lineLimit'\n>\n\n/** What the host is told about a fenced block when it chooses that block's props. */\nexport type MessageCodeBlockInfo = Readonly<{\n /** Position among the text's fenced blocks, from 0. */\n index: number\n language: string | undefined\n code: string\n complete: boolean\n}>\n\n/**\n * How `MessageText` draws citation markers. `count` is how many sources the host\n * has; a `[^n]` marker is a citation only when every `n` is within it. `render`\n * receives the 1-based source numbers and draws the marker, so the host decides\n * what a number means (`messageCitations` in the inline-citation composite does\n * this for a `Source` list).\n */\nexport type MessageCitations = Readonly<{\n count: number\n render: (numbers: readonly number[]) => JSX.Element\n}>\n\nexport type MessageTextProps = Omit<ComponentProps<'div'>, 'children'> & {\n text: string\n /** True while text may still arrive: a trailing open fence renders as partial code. */\n streaming?: boolean\n /**\n * Forwarded to each fenced block, e.g. to supply a lazy highlighter. A function\n * chooses per block, which is how line marks reach a block: marks belong to the\n * host's knowledge of the code (a diff, a failing line), never to the text.\n */\n codeBlockProps?: MessageCodeBlockProps | ((block: MessageCodeBlockInfo) => MessageCodeBlockProps)\n /** Without it, `[^1]` stays the literal text it was written as. */\n citations?: MessageCitations\n}\n\nfunction sameBlock(a: MessageBlock | undefined, b: MessageBlock): boolean {\n return (\n a !== undefined &&\n a.kind === b.kind &&\n a.raw === b.raw &&\n (a.kind !== 'code' || (b.kind === 'code' && a.complete === b.complete))\n )\n}\n\n/**\n * Text, read safely.\n *\n * Renders `parseMessageText`'s blocks as elements: nothing is interpreted as\n * HTML and a link only becomes an anchor when its scheme is http, https or\n * mailto. Blocks are kept by *position* and reuse their previous parsed object\n * when unchanged, so a streaming turn updates the block that is growing and\n * leaves every earlier paragraph and code block — and any selection or focus\n * inside them — untouched.\n */\nexport function MessageText(props: MessageTextProps) {\n const local = props\n const rest = omit(props, 'class', 'text', 'streaming', 'codeBlockProps', 'citations')\n let previous: readonly MessageBlock[] = []\n let previousCount = 0\n let parsed: MessageParse | undefined\n // Only the number of sources reaches the parser, so a new `render` function\n // does not reparse the text, and a changed count does.\n const citationCount = () => local.citations?.count ?? 0\n const blocks = createMemo(() => {\n const count = citationCount()\n if (count !== previousCount) previous = []\n previousCount = count\n // A streamed reply only grows, so each delta parses the tail it touched\n // rather than the whole reply (which made a long reply quadratic).\n parsed = parseMessageTextIncremental(parsed, local.text, {\n streaming: local.streaming,\n citations: count || undefined,\n })\n const next = parsed.blocks\n const merged = next.map((block, index) =>\n sameBlock(previous[index], block) ? previous[index]! : block\n )\n previous = merged\n return merged\n })\n // The nth fenced block, so a host can address it. Blocks keep their positions\n // while text streams in after them, so an index stays attached to its block.\n const codeIndexes = createMemo(() => {\n let next = 0\n return blocks().map((block) => (block.kind === 'code' ? next++ : -1))\n })\n const lastIsProse = () => {\n const last = blocks().at(-1)\n return last !== undefined && last.kind !== 'code'\n }\n return (\n <div data-slot=\"message-text\" class={cn('flex min-w-0 flex-col gap-3', local.class)} {...rest}>\n <For keyed={false} each={blocks()}>\n {(block, index) => (\n <BlockView\n block={block()}\n codeProps={local.codeBlockProps}\n codeIndex={() => codeIndexes()[index] ?? 0}\n citations={local.citations}\n />\n )}\n </For>\n <Show when={local.streaming && lastIsProse()}>\n <span class=\"streaming-caret\" aria-hidden=\"true\" />\n </Show>\n </div>\n )\n}\n\nfunction BlockView(props: {\n block: MessageBlock\n codeProps?: MessageTextProps['codeBlockProps']\n codeIndex: () => number\n citations?: MessageCitations\n}) {\n return (\n <Switch>\n <Match when={props.block.kind === 'code' && props.block}>\n {(block) => {\n const code = () => block() as Extract<MessageBlock, { kind: 'code' }>\n const chosen = () => {\n const choice = props.codeProps\n return typeof choice === 'function'\n ? choice({\n index: props.codeIndex(),\n language: code().language,\n code: code().code,\n complete: code().complete,\n })\n : choice\n }\n return (\n <CodeBlock\n code={code().code}\n language={code().language}\n complete={code().complete}\n {...chosen()}\n />\n )\n }}\n </Match>\n <Match when={props.block.kind === 'heading' && props.block}>\n {(block) => {\n const heading = () => block() as Extract<MessageBlock, { kind: 'heading' }>\n return (\n <p\n role=\"heading\"\n aria-level={heading().level + 2}\n class=\"font-semibold text-foreground [overflow-wrap:anywhere]\"\n >\n <Inline nodes={heading().inline} citations={props.citations} />\n </p>\n )\n }}\n </Match>\n <Match when={props.block.kind === 'list' && props.block}>\n {(block) => {\n const list = () => block() as Extract<MessageBlock, { kind: 'list' }>\n return (\n <Show\n when={list().ordered}\n fallback={\n <ul class=\"m-0 ms-5 flex list-disc flex-col gap-1 p-0 marker:text-muted-foreground\">\n <For each={list().items}>\n {(item) => (\n <li class=\"[overflow-wrap:anywhere]\">\n <Inline nodes={item} citations={props.citations} />\n </li>\n )}\n </For>\n </ul>\n }\n >\n <ol\n start={list().start}\n class=\"m-0 ms-5 flex list-decimal flex-col gap-1 p-0 marker:text-muted-foreground\"\n >\n <For each={list().items}>\n {(item) => (\n <li class=\"[overflow-wrap:anywhere]\">\n <Inline nodes={item} citations={props.citations} />\n </li>\n )}\n </For>\n </ol>\n </Show>\n )\n }}\n </Match>\n <Match when={props.block.kind === 'quote' && props.block}>\n {(block) => {\n const quote = () => block() as Extract<MessageBlock, { kind: 'quote' }>\n return (\n <blockquote class=\"m-0 border-s-2 border-border ps-3 whitespace-pre-wrap text-muted-foreground [overflow-wrap:anywhere]\">\n <Inline nodes={quote().inline} citations={props.citations} />\n </blockquote>\n )\n }}\n </Match>\n <Match when={props.block.kind === 'paragraph' && props.block}>\n {(block) => {\n const paragraph = () => block() as Extract<MessageBlock, { kind: 'paragraph' }>\n return (\n <p class=\"m-0 whitespace-pre-wrap [overflow-wrap:anywhere]\">\n <Inline nodes={paragraph().inline} citations={props.citations} />\n </p>\n )\n }}\n </Match>\n </Switch>\n )\n}\n\nfunction Inline(props: { nodes: readonly MessageInline[]; citations?: MessageCitations }) {\n // By position, not identity: the parser returns fresh nodes for the growing\n // paragraph on every streamed token, and a keyed list would rebuild each one.\n return (\n <For keyed={false} each={props.nodes}>\n {(node) => (\n <Switch>\n {/* Fragments keep the reads reactive: Match runs its callback untracked. */}\n <Match when={node().kind === 'text' && node()}>\n {(text) => <>{(text() as { text: string }).text}</>}\n </Match>\n <Match when={node().kind === 'code' && node()}>\n {(code) => <InlineCode>{(code() as { text: string }).text}</InlineCode>}\n </Match>\n <Match when={node().kind === 'strong' && node()}>\n {(strong) => (\n <strong class=\"font-semibold\">\n <Inline\n nodes={(strong() as { children: readonly MessageInline[] }).children}\n citations={props.citations}\n />\n </strong>\n )}\n </Match>\n <Match when={node().kind === 'em' && node()}>\n {(em) => (\n <em>\n <Inline\n nodes={(em() as { children: readonly MessageInline[] }).children}\n citations={props.citations}\n />\n </em>\n )}\n </Match>\n <Match when={node().kind === 'link' && node()}>\n {(link) => (\n <a\n href={(link() as { href: string }).href}\n target=\"_blank\"\n rel=\"noreferrer noopener\"\n class=\"text-primary underline underline-offset-2 hover:no-underline\"\n >\n <Inline nodes={(link() as { children: readonly MessageInline[] }).children} />\n </a>\n )}\n </Match>\n <Match when={node().kind === 'cite' && node()}>\n {(cite) => {\n const marker = () => cite() as { numbers: readonly number[]; raw: string }\n // The parser read this as a citation only while the host had sources;\n // if they have gone since, the marker is the text it was written as.\n // Match invokes this callback untracked; JSX keeps renderer and\n // same-count source replacements reactive without replacing the block.\n return (\n <>{props.citations ? props.citations.render(marker().numbers) : marker().raw}</>\n )\n }}\n </Match>\n </Switch>\n )}\n </For>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AA8CA,SAAgB,QAAQ,OAAqB;CAC3C,MAAM,QAAQ;CACd,MAAM,OAAO,KAAK,OAAO,SAAS,QAAQ,SAAS,aAAa,YAAY,UAAU;CAEpF,IAAA,OAAA,OAoBS;CAHPmE,OAAA,MAAA,CAAA;EAhBA,aAAA;EACA,IAAA,cAAA;GAAW,OAAA,MAAM;EAAI;EACrB,IAAA,mBAAA;GAAgB,OAAA,MAAM;EAAQ;EAC9B,IAAA,eAAA;GAAY,OAAA,MAAM;EAAK;EACvB,IAAA,cAAA;GAAW,OAAA,MAAM,YAAY,SAAS,KAAA;EAAS;EAC/C,IAAA,UAAA;GAAO,OAAA,GACL,2EAGA,gEACA;IACE,uCAAuC,MAAM,SAAS;IACtD,iBAAiB,MAAM,SAAS;GAClC,GACA,MAAM,KACR;EAAC;CACO,GAAJ,IAAA,GAAA,IAAA;CAjBNC,OAAA,YAmBE;EAAC,OAAA,MAAM;CAAQ,CACR;CArBX,OACEpE;AAsBJ;;AAGA,SAAgB,cACd,OACA;CACA,MAAM,QAAQ;CACd,MAAM,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A;QAAW,OAAA,MAAM;OAAS;MAC3B,CAAA,CACC;MALJ,OAAA;KAKI,EAAA,CAAA;IAED,CAAA;IACPC,gBAAAA,OAAAA;KAAO,IAAA,OAAA;MAAMC,OAAAA,WAAAA;OAAK,OAAA,KAAA,CAAC,CAAC,SAAS;MAAe,CAAA,CAAC,CAAD,KAAL,KAAK;KAAC;KAA7CD,WACI,gBACA;MAOG,IAAA,SAAA,SAAA;;MAPHO,OAAA,QAMEL,gBAAAA,QAAAA,EAAQ,IAAA,QAAA;OAAQ,OAAA,KAAK,CAAA,CAA6C;MAAQ,EAAG,CAAA,CAC5E;MANDM,aAAO,KAAK,CAAA,CAAuB,OAAnC,QAAA;OAAuCC,aAAA,QAAA,QAAA,GAAA;;;MADzC,OAAA;KAOG,EAAA,CAAA;IAEA,CAAA;IACPN,gBAAAA,OAAAA;KAAO,IAAA,OAAA;MAAMC,OAAAA,WAAAA;OAAK,OAAA,KAAA,CAAC,CAAC,SAAS;MAAe,CAAA,CAAC,CAAD,KAAL,KAAK;KAAC;KAA7CD,WACI,SAAS;MACT,MAAM,eAAe,KAAK;MAK1B,OACIE,WAAAA;;QAAC,OAAA,CAAA,CAAA,MAAM;OAAmE,CAAA,CAAC,CAAD,IAAvD,MAAM,UAAU,OAAO,OAAO,CAAC,CAAC,OAAO,IAAI,OAAO,CAAC,CAAC;MAAG,CAAA;KAEhF;IACK,CAAA;GAlDR;EAmDO,EAAA,CAAA;CAEP,CAAA;AAET"}
@@ -1,8 +1,8 @@
1
+ import { createComponent, insert, memo, mergeProps, template } from "@solidjs/web";
2
+ import { Show, createEffect, createSignal, omit } from "solid-js";
1
3
  import { holdKitInert, lateLayerAttribute } from "../../../lib/overlay.js";
2
4
  import { cn } from "../../../lib/utils.js";
3
5
  import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from "../dialog/dialog.js";
4
- import { createComponent, insert, memo, mergeProps, template } from "@solidjs/web";
5
- import { Show, createEffect, createSignal, omit } from "solid-js";
6
6
  // src/components/ui/modal-dialog/modal-dialog.tsx
7
7
  var _tmpl$ = /* @__PURE__ */ template(`<div class="-mx-1 flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto p-1">`);
8
8
  var _tmpl$2 = /* @__PURE__ */ template(`<div class="flex shrink-0 flex-wrap justify-end gap-2 border-t border-border pt-3">`);
@@ -1 +1 @@
1
- {"version":3,"file":"modal-dialog.js","names":["<Show when={local.open}>\n <Dialog\n open\n modal={local.modal ?? true}\n onOpenChange={(next: boolean) => !next && local.onClose()}\n >\n <DialogContent\n ref={setContent}\n positioner={local.size === 'settings' ? 'inset' : 'default'}\n class={cn(\n 'gap-4',\n local.size === 'settings' &&\n 'flex h-208 max-h-full min-h-0 max-w-6xl flex-col gap-0 overflow-hidden p-0',\n local.size === 'fit' && 'flex flex-col overflow-hidden',\n local.class\n )}\n aria-label={local['aria-label'] ?? local.title}\n aria-labelledby={\n local['aria-labelledby'] ?? (local['aria-label'] !== undefined ? '' : undefined)\n }\n {...rest}\n >\n <DialogHeader\n band={local.size === 'settings'}\n class={\n local.size === 'settings'\n ? 'shrink-0 gap-1 border-b border-border px-5 pt-4 pb-3 pe-14'\n : undefined\n }\n >\n <DialogTitle class=\"flex items-center gap-2\">\n <Show when={local.headerLeading}>\n {(headerLeadingSlot) => <>{headerLeadingSlot()}</>}\n </Show>\n {local.title}\n </DialogTitle>\n <Show when={local.description}>\n {(descriptionSlot) => <DialogDescription>{descriptionSlot()}</DialogDescription>}\n </Show>\n </DialogHeader>\n <Show when={local.size === 'fit'} fallback={local.children}>\n {/* The scrollport takes the room the title band and footer leave. The\n padding and matching negative margin keep a focused control's ring\n from being clipped at the scrollport's edge. */}\n <div class=\"-mx-1 flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto p-1\">\n {local.children}\n </div>\n <Show when={local.footer}>\n {(footerSlot) => (\n <div class=\"flex shrink-0 flex-wrap justify-end gap-2 border-t border-border pt-3\">\n {footerSlot()}\n </div>\n )}\n </Show>\n </Show>\n </DialogContent>\n </Dialog>\n </Show>","<Dialog\n open\n modal={local.modal ?? true}\n onOpenChange={(next: boolean) => !next && local.onClose()}\n >\n <DialogContent\n ref={setContent}\n positioner={local.size === 'settings' ? 'inset' : 'default'}\n class={cn(\n 'gap-4',\n local.size === 'settings' &&\n 'flex h-208 max-h-full min-h-0 max-w-6xl flex-col gap-0 overflow-hidden p-0',\n local.size === 'fit' && 'flex flex-col overflow-hidden',\n local.class\n )}\n aria-label={local['aria-label'] ?? local.title}\n aria-labelledby={\n local['aria-labelledby'] ?? (local['aria-label'] !== undefined ? '' : undefined)\n }\n {...rest}\n >\n <DialogHeader\n band={local.size === 'settings'}\n class={\n local.size === 'settings'\n ? 'shrink-0 gap-1 border-b border-border px-5 pt-4 pb-3 pe-14'\n : undefined\n }\n >\n <DialogTitle class=\"flex items-center gap-2\">\n <Show when={local.headerLeading}>\n {(headerLeadingSlot) => <>{headerLeadingSlot()}</>}\n </Show>\n {local.title}\n </DialogTitle>\n <Show when={local.description}>\n {(descriptionSlot) => <DialogDescription>{descriptionSlot()}</DialogDescription>}\n </Show>\n </DialogHeader>\n <Show when={local.size === 'fit'} fallback={local.children}>\n {/* The scrollport takes the room the title band and footer leave. The\n padding and matching negative margin keep a focused control's ring\n from being clipped at the scrollport's edge. */}\n <div class=\"-mx-1 flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto p-1\">\n {local.children}\n </div>\n <Show when={local.footer}>\n {(footerSlot) => (\n <div class=\"flex shrink-0 flex-wrap justify-end gap-2 border-t border-border pt-3\">\n {footerSlot()}\n </div>\n )}\n </Show>\n </Show>\n </DialogContent>\n </Dialog>","onOpenChange={(next: boolean) => !next && local.onClose()}","<DialogContent\n ref={setContent}\n positioner={local.size === 'settings' ? 'inset' : 'default'}\n class={cn(\n 'gap-4',\n local.size === 'settings' &&\n 'flex h-208 max-h-full min-h-0 max-w-6xl flex-col gap-0 overflow-hidden p-0',\n local.size === 'fit' && 'flex flex-col overflow-hidden',\n local.class\n )}\n aria-label={local['aria-label'] ?? local.title}\n aria-labelledby={\n local['aria-labelledby'] ?? (local['aria-label'] !== undefined ? '' : undefined)\n }\n {...rest}\n >\n <DialogHeader\n band={local.size === 'settings'}\n class={\n local.size === 'settings'\n ? 'shrink-0 gap-1 border-b border-border px-5 pt-4 pb-3 pe-14'\n : undefined\n }\n >\n <DialogTitle class=\"flex items-center gap-2\">\n <Show when={local.headerLeading}>\n {(headerLeadingSlot) => <>{headerLeadingSlot()}</>}\n </Show>\n {local.title}\n </DialogTitle>\n <Show when={local.description}>\n {(descriptionSlot) => <DialogDescription>{descriptionSlot()}</DialogDescription>}\n </Show>\n </DialogHeader>\n <Show when={local.size === 'fit'} fallback={local.children}>\n {/* The scrollport takes the room the title band and footer leave. The\n padding and matching negative margin keep a focused control's ring\n from being clipped at the scrollport's edge. */}\n <div class=\"-mx-1 flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto p-1\">\n {local.children}\n </div>\n <Show when={local.footer}>\n {(footerSlot) => (\n <div class=\"flex shrink-0 flex-wrap justify-end gap-2 border-t border-border pt-3\">\n {footerSlot()}\n </div>\n )}\n </Show>\n </Show>\n </DialogContent>","ref={setContent}","<DialogHeader\n band={local.size === 'settings'}\n class={\n local.size === 'settings'\n ? 'shrink-0 gap-1 border-b border-border px-5 pt-4 pb-3 pe-14'\n : undefined\n }\n >\n <DialogTitle class=\"flex items-center gap-2\">\n <Show when={local.headerLeading}>\n {(headerLeadingSlot) => <>{headerLeadingSlot()}</>}\n </Show>\n {local.title}\n </DialogTitle>\n <Show when={local.description}>\n {(descriptionSlot) => <DialogDescription>{descriptionSlot()}</DialogDescription>}\n </Show>\n </DialogHeader>","<DialogTitle class=\"flex items-center gap-2\">\n <Show when={local.headerLeading}>\n {(headerLeadingSlot) => <>{headerLeadingSlot()}</>}\n </Show>\n {local.title}\n </DialogTitle>","class=\"flex items-center gap-2\"","<Show when={local.headerLeading}>\n {(headerLeadingSlot) => <>{headerLeadingSlot()}</>}\n </Show>","{headerLeadingSlot()}","local.title","<Show when={local.description}>\n {(descriptionSlot) => <DialogDescription>{descriptionSlot()}</DialogDescription>}\n </Show>","<DialogDescription>{descriptionSlot()}</DialogDescription>","<Show when={local.size === 'fit'} fallback={local.children}>\n {/* The scrollport takes the room the title band and footer leave. The\n padding and matching negative margin keep a focused control's ring\n from being clipped at the scrollport's edge. */}\n <div class=\"-mx-1 flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto p-1\">\n {local.children}\n </div>\n <Show when={local.footer}>\n {(footerSlot) => (\n <div class=\"flex shrink-0 flex-wrap justify-end gap-2 border-t border-border pt-3\">\n {footerSlot()}\n </div>\n )}\n </Show>\n </Show>","<Show when={local.footer}>\n {(footerSlot) => (\n <div class=\"flex shrink-0 flex-wrap justify-end gap-2 border-t border-border pt-3\">\n {footerSlot()}\n </div>\n )}\n </Show>"],"sources":["../../../../src/components/ui/modal-dialog/modal-dialog.tsx"],"sourcesContent":["import type { ComponentProps, JSX } from '@solidjs/web'\nimport { Show, createEffect, createSignal, omit } from 'solid-js'\nimport { holdKitInert, lateLayerAttribute } from '#lib/overlay'\nimport { cn } from '#lib/utils'\nimport { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from '../dialog'\n\n/**\n * ModalDialog.\n *\n * A dialog that owns five things `Dialog` leaves to its caller, each of which is a\n * real defect when it is missed:\n *\n * 1. **It unmounts while closed.** An always-mounted dialog that closes as a side\n * effect of an async action can leave the modal layer's background `inert`\n * bookkeeping behind, which takes the rest of the application out of the tab order\n * and the accessibility tree. Unmounting the whole owner makes cleanup the only\n * way the layer can end.\n * 2. **It marks the background `inert` itself.** It does not depend on the\n * layer's bookkeeping for that, and it restores exactly the elements that did\n * not already have it, so a nested dialog does not un-inert its parent and an\n * element the app made inert stays inert.\n * 3. **It sets an explicit accessible name.** The content receives `aria-label`\n * from `title`, so its name does not depend on the title id registration effect.\n * Pass `aria-label` to use a different name while keeping the visible title;\n * pass `aria-labelledby` when another visible label should take precedence.\n * 4. **It returns focus to the opener**, as every `DialogContent` does. For a\n * controlled dialog whose opener cannot be inferred from the focused element,\n * pass `restoreFocusRef`.\n * 5. **It keeps its own portal out of an enclosing layer's hide-outside pass.**\n * The portal carries `lateLayerAttribute`, the marker a layer that hides\n * late-arriving body children exempts, so a non-modal dialog opened while a modal\n * `Sheet` is alive is not hidden one frame after it mounts. (Kobalte's observer\n * aria-hid such children; ui-sdk makes the background `inert` element by element\n * when its layer opens.) A modal layer opened above still makes it inert.\n *\n * Use `Dialog` directly when you need its composition; use this when you want a\n * dialog that is correct by default. `size=\"settings\"` supplies a wide, bounded\n * shell for a shared settings layout, titled by a banded header like a sheet's;\n * ordinary dialogs keep their compact default. Every centred dialog stays inside\n * the window: past the window's height it scrolls rather than running off its\n * edges. `size=\"fit\"` is for a dialog whose body can grow (a scan result, a long\n * plan) and whose actions must stay in view: the title and `footer` stay put and\n * the children scroll between them.\n */\nexport type ModalDialogProps = Omit<\n ComponentProps<typeof DialogContent>,\n 'children' | 'aria-label' | 'aria-labelledby' | 'positioner' | 'description' | 'size'\n> & {\n /**\n * `settings` selects the bounded, scrollable shell used for grouped workspace\n * settings. `fit` keeps the compact default width but lets the dialog's content\n * decide its height up to the window: the title band stays put, the children\n * scroll, and `footer` stays in view beneath them.\n */\n size?: 'default' | 'settings' | 'fit'\n /**\n * Actions that must stay reachable however long the content is (Cancel and a\n * primary button). Rendered under the scrolling children, outside the scroll\n * area, and only by the `fit` size.\n */\n footer?: JSX.Element\n open: boolean\n onClose: () => void\n title: string\n /**\n * Controls the dialog's focus, scroll and accessibility modality. Defaults to `true`;\n * background body children remain inert in either mode.\n */\n modal?: boolean\n description?: string\n /** A mark or icon drawn before the title. */\n headerLeading?: JSX.Element\n /** Replaces `title` as the accessible name while keeping the visible title. */\n 'aria-label'?: string\n /** Names the dialog from a visible element; ARIA gives it precedence over `aria-label`. */\n 'aria-labelledby'?: string\n children?: JSX.Element\n}\n\nexport function ModalDialog(props: ModalDialogProps) {\n const local = props\n const rest = omit(\n props,\n 'open',\n 'onClose',\n 'title',\n 'modal',\n 'size',\n 'footer',\n 'description',\n 'headerLeading',\n 'class',\n 'children',\n 'aria-label',\n 'aria-labelledby'\n )\n\n const [content, setContent] = createSignal<HTMLElement>()\n\n createEffect(\n () => (local.open ? content() : undefined),\n (element) => {\n if (!element) return\n\n const background = [...document.body.children].filter(\n (child): child is HTMLElement => child instanceof HTMLElement && !child.contains(element)\n )\n const wasInert = background.map((node) => node.hasAttribute('inert'))\n const releaseKitInert = holdKitInert(background)\n for (const node of background) node.setAttribute('inert', '')\n\n // The dialog's portal owns the body child, so the marker goes on after mount.\n let portal = element\n while (portal.parentElement !== null && portal.parentElement !== document.body) {\n portal = portal.parentElement\n }\n portal.setAttribute(lateLayerAttribute, 'true')\n\n return () => {\n background.forEach((node, index) => {\n // Only the elements that were not already inert are restored, so a nested\n // dialog closing does not undo its parent's containment.\n if (!wasInert[index]) node.removeAttribute('inert')\n })\n portal.removeAttribute(lateLayerAttribute)\n // After the removals above, so the dialog layer's inert guard has read them.\n queueMicrotask(releaseKitInert)\n }\n }\n )\n\n return (\n <Show when={local.open}>\n <Dialog\n open\n modal={local.modal ?? true}\n onOpenChange={(next: boolean) => !next && local.onClose()}\n >\n <DialogContent\n ref={setContent}\n positioner={local.size === 'settings' ? 'inset' : 'default'}\n class={cn(\n 'gap-4',\n local.size === 'settings' &&\n 'flex h-208 max-h-full min-h-0 max-w-6xl flex-col gap-0 overflow-hidden p-0',\n local.size === 'fit' && 'flex flex-col overflow-hidden',\n local.class\n )}\n aria-label={local['aria-label'] ?? local.title}\n aria-labelledby={\n local['aria-labelledby'] ?? (local['aria-label'] !== undefined ? '' : undefined)\n }\n {...rest}\n >\n <DialogHeader\n band={local.size === 'settings'}\n class={\n local.size === 'settings'\n ? 'shrink-0 gap-1 border-b border-border px-5 pt-4 pb-3 pe-14'\n : undefined\n }\n >\n <DialogTitle class=\"flex items-center gap-2\">\n <Show when={local.headerLeading}>\n {(headerLeadingSlot) => <>{headerLeadingSlot()}</>}\n </Show>\n {local.title}\n </DialogTitle>\n <Show when={local.description}>\n {(descriptionSlot) => <DialogDescription>{descriptionSlot()}</DialogDescription>}\n </Show>\n </DialogHeader>\n <Show when={local.size === 'fit'} fallback={local.children}>\n {/* The scrollport takes the room the title band and footer leave. The\n padding and matching negative margin keep a focused control's ring\n from being clipped at the scrollport's edge. */}\n <div class=\"-mx-1 flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto p-1\">\n {local.children}\n </div>\n <Show when={local.footer}>\n {(footerSlot) => (\n <div class=\"flex shrink-0 flex-wrap justify-end gap-2 border-t border-border pt-3\">\n {footerSlot()}\n </div>\n )}\n </Show>\n </Show>\n </DialogContent>\n </Dialog>\n </Show>\n )\n}\n"],"mappings":";;;;;;;;AA+EA,SAAgB,YAAY,OAAyB;CACnD,MAAM,QAAQ;CACd,MAAM,OAAO,KACX,OACA,QACA,WACA,SACA,SACA,QACA,UACA,eACA,iBACA,SACA,YACA,cACA,iBACF;CAEA,MAAM,CAAC,SAAS,cAAc,aAA0B;CAExD,mBACS,MAAM,OAAO,QAAQ,IAAI,KAAA,IAC/B,YAAY;EACX,IAAI,CAAC,SAAS;EAEd,MAAM,aAAa,CAAC,GAAG,SAAS,KAAK,QAAQ,CAAC,CAAC,QAC5C,UAAgC,iBAAiB,eAAe,CAAC,MAAM,SAAS,OAAO,CAC1F;EACA,MAAM,WAAW,WAAW,KAAK,SAAS,KAAK,aAAa,OAAO,CAAC;EACpE,MAAM,kBAAkB,aAAa,UAAU;EAC/C,KAAK,MAAM,QAAQ,YAAY,KAAK,aAAa,SAAS,EAAE;EAG5D,IAAI,SAAS;EACb,OAAO,OAAO,kBAAkB,QAAQ,OAAO,kBAAkB,SAAS,MACxE,SAAS,OAAO;EAElB,OAAO,aAAa,oBAAoB,MAAM;EAE9C,aAAa;GACX,WAAW,SAAS,MAAM,UAAU;IAGlC,IAAI,CAAC,SAAS,QAAQ,KAAK,gBAAgB,OAAO;GACpD,CAAC;G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WAAAA;SAAoB,OAAA,gBAAgB;QAAqB,EAAA,CAAA;OAC3E,CAAA,CARP;MASa;KACdC,CAAAA,GAAAA,gBAAAA,MAAAA;MAAM,IAAA,OAAA;OAAM,OAAA,MAAM,SAAS;MAAK;MAAE,IAAA,WAAA;OAAU,OAAA,MAAM;MAAQ;MAA1D,IAAA,WAAA;OAA4D,OAAA,QAI1D;QAEK,IAAA,OAAA,OAAA;QAFL,OAAA,YACE;SAAC,OAAA,MAAM;QAAQ,CACZ;QAFL,OAAA;OAEK,EAAA,CAAA,GACLC,gBAAAA,MAAAA;QAAM,IAAA,OAAA;SAAM,OAAA,MAAM;QAAM;QAAxBA,WACI,sBACA;SAEK,IAAA,QAAA,QAAA;SAFL,OAAA,OACG,UACE;SAFL,OAAA;QAEK,EAAA,CAAA;OAEH,CAAA,CAZP;MAaK;KAhCP,CAAA,CAAA;IAiCc,EAAA,CAAA,CAAA;GACT;EAxDV,CAAA,IAAA,KAAA;CAyDM,CAAA;AAEV"}
1
+ {"version":3,"file":"modal-dialog.js","names":["<Show when={local.open}>\n <Dialog\n open\n modal={local.modal ?? true}\n onOpenChange={(next: boolean) => !next && local.onClose()}\n >\n <DialogContent\n ref={setContent}\n positioner={local.size === 'settings' ? 'inset' : 'default'}\n class={cn(\n 'gap-4',\n local.size === 'settings' &&\n 'flex h-208 max-h-full min-h-0 max-w-6xl flex-col gap-0 overflow-hidden p-0',\n local.size === 'fit' && 'flex flex-col overflow-hidden',\n local.class\n )}\n aria-label={local['aria-label'] ?? local.title}\n aria-labelledby={\n local['aria-labelledby'] ?? (local['aria-label'] !== undefined ? '' : undefined)\n }\n {...rest}\n >\n <DialogHeader\n band={local.size === 'settings'}\n class={\n local.size === 'settings'\n ? 'shrink-0 gap-1 border-b border-border px-5 pt-4 pb-3 pe-14'\n : undefined\n }\n >\n <DialogTitle class=\"flex items-center gap-2\">\n <Show when={local.headerLeading}>\n {(headerLeadingSlot) => <>{headerLeadingSlot()}</>}\n </Show>\n {local.title}\n </DialogTitle>\n <Show when={local.description}>\n {(descriptionSlot) => <DialogDescription>{descriptionSlot()}</DialogDescription>}\n </Show>\n </DialogHeader>\n <Show when={local.size === 'fit'} fallback={local.children}>\n {/* The scrollport takes the room the title band and footer leave. The\n padding and matching negative margin keep a focused control's ring\n from being clipped at the scrollport's edge. */}\n <div class=\"-mx-1 flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto p-1\">\n {local.children}\n </div>\n <Show when={local.footer}>\n {(footerSlot) => (\n <div class=\"flex shrink-0 flex-wrap justify-end gap-2 border-t border-border pt-3\">\n {footerSlot()}\n </div>\n )}\n </Show>\n </Show>\n </DialogContent>\n </Dialog>\n </Show>","<Dialog\n open\n modal={local.modal ?? true}\n onOpenChange={(next: boolean) => !next && local.onClose()}\n >\n <DialogContent\n ref={setContent}\n positioner={local.size === 'settings' ? 'inset' : 'default'}\n class={cn(\n 'gap-4',\n local.size === 'settings' &&\n 'flex h-208 max-h-full min-h-0 max-w-6xl flex-col gap-0 overflow-hidden p-0',\n local.size === 'fit' && 'flex flex-col overflow-hidden',\n local.class\n )}\n aria-label={local['aria-label'] ?? local.title}\n aria-labelledby={\n local['aria-labelledby'] ?? (local['aria-label'] !== undefined ? '' : undefined)\n }\n {...rest}\n >\n <DialogHeader\n band={local.size === 'settings'}\n class={\n local.size === 'settings'\n ? 'shrink-0 gap-1 border-b border-border px-5 pt-4 pb-3 pe-14'\n : undefined\n }\n >\n <DialogTitle class=\"flex items-center gap-2\">\n <Show when={local.headerLeading}>\n {(headerLeadingSlot) => <>{headerLeadingSlot()}</>}\n </Show>\n {local.title}\n </DialogTitle>\n <Show when={local.description}>\n {(descriptionSlot) => <DialogDescription>{descriptionSlot()}</DialogDescription>}\n </Show>\n </DialogHeader>\n <Show when={local.size === 'fit'} fallback={local.children}>\n {/* The scrollport takes the room the title band and footer leave. The\n padding and matching negative margin keep a focused control's ring\n from being clipped at the scrollport's edge. */}\n <div class=\"-mx-1 flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto p-1\">\n {local.children}\n </div>\n <Show when={local.footer}>\n {(footerSlot) => (\n <div class=\"flex shrink-0 flex-wrap justify-end gap-2 border-t border-border pt-3\">\n {footerSlot()}\n </div>\n )}\n </Show>\n </Show>\n </DialogContent>\n </Dialog>","onOpenChange={(next: boolean) => !next && local.onClose()}","<DialogContent\n ref={setContent}\n positioner={local.size === 'settings' ? 'inset' : 'default'}\n class={cn(\n 'gap-4',\n local.size === 'settings' &&\n 'flex h-208 max-h-full min-h-0 max-w-6xl flex-col gap-0 overflow-hidden p-0',\n local.size === 'fit' && 'flex flex-col overflow-hidden',\n local.class\n )}\n aria-label={local['aria-label'] ?? local.title}\n aria-labelledby={\n local['aria-labelledby'] ?? (local['aria-label'] !== undefined ? '' : undefined)\n }\n {...rest}\n >\n <DialogHeader\n band={local.size === 'settings'}\n class={\n local.size === 'settings'\n ? 'shrink-0 gap-1 border-b border-border px-5 pt-4 pb-3 pe-14'\n : undefined\n }\n >\n <DialogTitle class=\"flex items-center gap-2\">\n <Show when={local.headerLeading}>\n {(headerLeadingSlot) => <>{headerLeadingSlot()}</>}\n </Show>\n {local.title}\n </DialogTitle>\n <Show when={local.description}>\n {(descriptionSlot) => <DialogDescription>{descriptionSlot()}</DialogDescription>}\n </Show>\n </DialogHeader>\n <Show when={local.size === 'fit'} fallback={local.children}>\n {/* The scrollport takes the room the title band and footer leave. The\n padding and matching negative margin keep a focused control's ring\n from being clipped at the scrollport's edge. */}\n <div class=\"-mx-1 flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto p-1\">\n {local.children}\n </div>\n <Show when={local.footer}>\n {(footerSlot) => (\n <div class=\"flex shrink-0 flex-wrap justify-end gap-2 border-t border-border pt-3\">\n {footerSlot()}\n </div>\n )}\n </Show>\n </Show>\n </DialogContent>","ref={setContent}","<DialogHeader\n band={local.size === 'settings'}\n class={\n local.size === 'settings'\n ? 'shrink-0 gap-1 border-b border-border px-5 pt-4 pb-3 pe-14'\n : undefined\n }\n >\n <DialogTitle class=\"flex items-center gap-2\">\n <Show when={local.headerLeading}>\n {(headerLeadingSlot) => <>{headerLeadingSlot()}</>}\n </Show>\n {local.title}\n </DialogTitle>\n <Show when={local.description}>\n {(descriptionSlot) => <DialogDescription>{descriptionSlot()}</DialogDescription>}\n </Show>\n </DialogHeader>","<DialogTitle class=\"flex items-center gap-2\">\n <Show when={local.headerLeading}>\n {(headerLeadingSlot) => <>{headerLeadingSlot()}</>}\n </Show>\n {local.title}\n </DialogTitle>","class=\"flex items-center gap-2\"","<Show when={local.headerLeading}>\n {(headerLeadingSlot) => <>{headerLeadingSlot()}</>}\n </Show>","{headerLeadingSlot()}","local.title","<Show when={local.description}>\n {(descriptionSlot) => <DialogDescription>{descriptionSlot()}</DialogDescription>}\n </Show>","<DialogDescription>{descriptionSlot()}</DialogDescription>","<Show when={local.size === 'fit'} fallback={local.children}>\n {/* The scrollport takes the room the title band and footer leave. The\n padding and matching negative margin keep a focused control's ring\n from being clipped at the scrollport's edge. */}\n <div class=\"-mx-1 flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto p-1\">\n {local.children}\n </div>\n <Show when={local.footer}>\n {(footerSlot) => (\n <div class=\"flex shrink-0 flex-wrap justify-end gap-2 border-t border-border pt-3\">\n {footerSlot()}\n </div>\n )}\n </Show>\n </Show>","<Show when={local.footer}>\n {(footerSlot) => (\n <div class=\"flex shrink-0 flex-wrap justify-end gap-2 border-t border-border pt-3\">\n {footerSlot()}\n </div>\n )}\n </Show>","_$insert"],"sources":["../../../../src/components/ui/modal-dialog/modal-dialog.tsx"],"sourcesContent":["import type { ComponentProps, JSX } from '@solidjs/web'\nimport { Show, createEffect, createSignal, omit } from 'solid-js'\nimport { holdKitInert, lateLayerAttribute } from '#lib/overlay'\nimport { cn } from '#lib/utils'\nimport { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from '../dialog'\n\n/**\n * ModalDialog.\n *\n * A dialog that owns five things `Dialog` leaves to its caller, each of which is a\n * real defect when it is missed:\n *\n * 1. **It unmounts while closed.** An always-mounted dialog that closes as a side\n * effect of an async action can leave the modal layer's background `inert`\n * bookkeeping behind, which takes the rest of the application out of the tab order\n * and the accessibility tree. Unmounting the whole owner makes cleanup the only\n * way the layer can end.\n * 2. **It marks the background `inert` itself.** It does not depend on the\n * layer's bookkeeping for that, and it restores exactly the elements that did\n * not already have it, so a nested dialog does not un-inert its parent and an\n * element the app made inert stays inert.\n * 3. **It sets an explicit accessible name.** The content receives `aria-label`\n * from `title`, so its name does not depend on the title id registration effect.\n * Pass `aria-label` to use a different name while keeping the visible title;\n * pass `aria-labelledby` when another visible label should take precedence.\n * 4. **It returns focus to the opener**, as every `DialogContent` does. For a\n * controlled dialog whose opener cannot be inferred from the focused element,\n * pass `restoreFocusRef`.\n * 5. **It keeps its own portal out of an enclosing layer's hide-outside pass.**\n * The portal carries `lateLayerAttribute`, the marker a layer that hides\n * late-arriving body children exempts, so a non-modal dialog opened while a modal\n * `Sheet` is alive is not hidden one frame after it mounts. (Kobalte's observer\n * aria-hid such children; ui-sdk makes the background `inert` element by element\n * when its layer opens.) A modal layer opened above still makes it inert.\n *\n * Use `Dialog` directly when you need its composition; use this when you want a\n * dialog that is correct by default. `size=\"settings\"` supplies a wide, bounded\n * shell for a shared settings layout, titled by a banded header like a sheet's;\n * ordinary dialogs keep their compact default. Every centred dialog stays inside\n * the window: past the window's height it scrolls rather than running off its\n * edges. `size=\"fit\"` is for a dialog whose body can grow (a scan result, a long\n * plan) and whose actions must stay in view: the title and `footer` stay put and\n * the children scroll between them.\n */\nexport type ModalDialogProps = Omit<\n ComponentProps<typeof DialogContent>,\n 'children' | 'aria-label' | 'aria-labelledby' | 'positioner' | 'description' | 'size'\n> & {\n /**\n * `settings` selects the bounded, scrollable shell used for grouped workspace\n * settings. `fit` keeps the compact default width but lets the dialog's content\n * decide its height up to the window: the title band stays put, the children\n * scroll, and `footer` stays in view beneath them.\n */\n size?: 'default' | 'settings' | 'fit'\n /**\n * Actions that must stay reachable however long the content is (Cancel and a\n * primary button). Rendered under the scrolling children, outside the scroll\n * area, and only by the `fit` size.\n */\n footer?: JSX.Element\n open: boolean\n onClose: () => void\n title: string\n /**\n * Controls the dialog's focus, scroll and accessibility modality. Defaults to `true`;\n * background body children remain inert in either mode.\n */\n modal?: boolean\n description?: string\n /** A mark or icon drawn before the title. */\n headerLeading?: JSX.Element\n /** Replaces `title` as the accessible name while keeping the visible title. */\n 'aria-label'?: string\n /** Names the dialog from a visible element; ARIA gives it precedence over `aria-label`. */\n 'aria-labelledby'?: string\n children?: JSX.Element\n}\n\nexport function ModalDialog(props: ModalDialogProps) {\n const local = props\n const rest = omit(\n props,\n 'open',\n 'onClose',\n 'title',\n 'modal',\n 'size',\n 'footer',\n 'description',\n 'headerLeading',\n 'class',\n 'children',\n 'aria-label',\n 'aria-labelledby'\n )\n\n const [content, setContent] = createSignal<HTMLElement>()\n\n createEffect(\n () => (local.open ? content() : undefined),\n (element) => {\n if (!element) return\n\n const background = [...document.body.children].filter(\n (child): child is HTMLElement => child instanceof HTMLElement && !child.contains(element)\n )\n const wasInert = background.map((node) => node.hasAttribute('inert'))\n const releaseKitInert = holdKitInert(background)\n for (const node of background) node.setAttribute('inert', '')\n\n // The dialog's portal owns the body child, so the marker goes on after mount.\n let portal = element\n while (portal.parentElement !== null && portal.parentElement !== document.body) {\n portal = portal.parentElement\n }\n portal.setAttribute(lateLayerAttribute, 'true')\n\n return () => {\n background.forEach((node, index) => {\n // Only the elements that were not already inert are restored, so a nested\n // dialog closing does not undo its parent's containment.\n if (!wasInert[index]) node.removeAttribute('inert')\n })\n portal.removeAttribute(lateLayerAttribute)\n // After the removals above, so the dialog layer's inert guard has read them.\n queueMicrotask(releaseKitInert)\n }\n }\n )\n\n return (\n <Show when={local.open}>\n <Dialog\n open\n modal={local.modal ?? true}\n onOpenChange={(next: boolean) => !next && local.onClose()}\n >\n <DialogContent\n ref={setContent}\n positioner={local.size === 'settings' ? 'inset' : 'default'}\n class={cn(\n 'gap-4',\n local.size === 'settings' &&\n 'flex h-208 max-h-full min-h-0 max-w-6xl flex-col gap-0 overflow-hidden p-0',\n local.size === 'fit' && 'flex flex-col overflow-hidden',\n local.class\n )}\n aria-label={local['aria-label'] ?? local.title}\n aria-labelledby={\n local['aria-labelledby'] ?? (local['aria-label'] !== undefined ? '' : undefined)\n }\n {...rest}\n >\n <DialogHeader\n band={local.size === 'settings'}\n class={\n local.size === 'settings'\n ? 'shrink-0 gap-1 border-b border-border px-5 pt-4 pb-3 pe-14'\n : undefined\n }\n >\n <DialogTitle class=\"flex items-center gap-2\">\n <Show when={local.headerLeading}>\n {(headerLeadingSlot) => <>{headerLeadingSlot()}</>}\n </Show>\n {local.title}\n </DialogTitle>\n <Show when={local.description}>\n {(descriptionSlot) => <DialogDescription>{descriptionSlot()}</DialogDescription>}\n </Show>\n </DialogHeader>\n <Show when={local.size === 'fit'} fallback={local.children}>\n {/* The scrollport takes the room the title band and footer leave. The\n padding and matching negative margin keep a focused control's ring\n from being clipped at the scrollport's edge. */}\n <div class=\"-mx-1 flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto p-1\">\n {local.children}\n </div>\n <Show when={local.footer}>\n {(footerSlot) => (\n <div class=\"flex shrink-0 flex-wrap justify-end gap-2 border-t border-border pt-3\">\n {footerSlot()}\n </div>\n )}\n </Show>\n </Show>\n </DialogContent>\n </Dialog>\n </Show>\n )\n}\n"],"mappings":";;;;;;;;AA+EA,SAAgB,YAAY,OAAyB;CACnD,MAAM,QAAQ;CACd,MAAM,OAAO,KACX,OACA,QACA,WACA,SACA,SACA,QACA,UACA,eACA,iBACA,SACA,YACA,cACA,iBACF;CAEA,MAAM,CAAC,SAAS,cAAc,aAA0B;CAExD,mBACS,MAAM,OAAO,QAAQ,IAAI,KAAA,IAC/B,YAAY;EACX,IAAI,CAAC,SAAS;EAEd,MAAM,aAAa,CAAC,GAAG,SAAS,KAAK,QAAQ,CAAC,CAAC,QAC5C,UAAgC,iBAAiB,eAAe,CAAC,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N;MANF,IAAA,WAAA;OAOC,OAAA,CACCC,gBAAAA,aAAAA;QAAaC,OAAM;QAAnB,IAAA,WAAA;SAA6C,OAAA,CAC3CC,gBAAAA,MAAAA;UAAM,IAAA,OAAA;WAAM,OAAA,MAAM;UAAa;UAA/BA,WACI,sBAAwBC,KAAC,iBAAmB;SAC1C,CAAA,GACLC,WAAAA;UAAM,OAAA,MAAA;SAAI,CAAA,CAHZ;QAIY;OACbC,CAAAA,GAAAA,gBAAAA,MAAAA;QAAM,IAAA,OAAA;SAAM,OAAA,MAAM;QAAW;QAA7BA,WACI,oBAAoBC,gBAAAA,mBAAAA,EAAAA,IAAAA,WAAAA;SAAoB,OAAA,gBAAgB;QAAqB,EAAA,CAAA;OAC3E,CAAA,CARP;MASa;KACdC,CAAAA,GAAAA,gBAAAA,MAAAA;MAAM,IAAA,OAAA;OAAM,OAAA,MAAM,SAAS;MAAK;MAAE,IAAA,WAAA;OAAU,OAAA,MAAM;MAAQ;MAA1D,IAAA,WAAA;OAA4D,OAAA,QAI1D;QAEK,IAAA,OAAA,OAAA;QAFLE,OAAA,YACE;SAAC,OAAA,MAAM;QAAQ,CACZ;QAFL,OAAA;OAEK,EAAA,CAAA,GACLD,gBAAAA,MAAAA;QAAM,IAAA,OAAA;SAAM,OAAA,MAAM;QAAM;QAAxBA,WACI,sBACA;SAEK,IAAA,QAAA,QAAA;SAFLC,OAAA,OACG,UACE;SAFL,OAAA;QAEK,EAAA,CAAA;OAEH,CAAA,CAZP;MAaK;KAhCP,CAAA,CAAA;IAiCc,EAAA,CAAA,CAAA;GACT;EAxDV,CAAA,IAAA,KAAA;CAyDM,CAAA;AAEV"}
@@ -1,13 +1,13 @@
1
+ import { className, createComponent, effect, heldRead, insert, readShallow, ref, setAttribute, spread, template } from "@solidjs/web";
2
+ import { ChevronDownIcon as ChevronDownIcon$1 } from "@lucide/solid";
3
+ import { For, Show, createEffect, omit } from "solid-js";
1
4
  import { useFormFieldControl } from "../../../lib/form-field.js";
2
5
  import { cn } from "../../../lib/utils.js";
3
6
  import { fastIcon } from "../../../lib/fast-icon.js";
4
- import { className, createComponent, effect, heldRead, insert, readShallow, ref, setAttribute, spread, template } from "@solidjs/web";
5
- import { ChevronDownIcon } from "@lucide/solid";
6
- import { For, Show, createEffect, omit } from "solid-js";
7
7
  // src/components/ui/native-select/native-select.tsx
8
8
  var _tmpl$ = /* @__PURE__ */ template(`<span data-slot=native-select-wrapper><select>`);
9
9
  var _tmpl$2 = /* @__PURE__ */ template(`<option>`);
10
- var ChevronDownIcon$1 = fastIcon(ChevronDownIcon);
10
+ var ChevronDownIcon = fastIcon(ChevronDownIcon$1);
11
11
  function setSelectedValue(select, value, multiple) {
12
12
  if (value === void 0) return;
13
13
  if (multiple && Array.isArray(value)) {
@@ -112,7 +112,7 @@ function NativeSelect(props) {
112
112
  })()
113
113
  })
114
114
  }));
115
- insert(_el$, createComponent(ChevronDownIcon$1, {
115
+ insert(_el$, createComponent(ChevronDownIcon, {
116
116
  "data-slot": "native-select-icon",
117
117
  "aria-hidden": "true",
118
118
  get "class"() {
@@ -1 +1 @@
1
- {"version":3,"file":"native-select.js","names":["ref={(element: HTMLSelectElement) => {\n select = element\n }}","<Show when={local.options} fallback={local.children}>\n {(options) => (\n <For each={options()}>\n {(option) => (\n <option\n value={option.value}\n disabled={option.disabled}\n selected={isControlledOptionSelected(\n rest.value,\n option.value,\n Boolean(rest.multiple)\n )}\n >\n {option.label}\n </option>\n )}\n </For>\n )}\n </Show>","<For each={options()}>\n {(option) => (\n <option\n value={option.value}\n disabled={option.disabled}\n selected={isControlledOptionSelected(\n rest.value,\n option.value,\n Boolean(rest.multiple)\n )}\n >\n {option.label}\n </option>\n )}\n </For>","disabled={option.disabled}","selected={isControlledOptionSelected(\n rest.value,\n option.value,\n Boolean(rest.multiple)\n )}","value={option.value}","<ChevronDownIcon\n data-slot=\"native-select-icon\"\n aria-hidden=\"true\"\n class={cn(\n 'pointer-events-none absolute end-2 top-1/2 -translate-y-1/2 text-muted-foreground',\n local.size === 'sm' ? 'size-3.5' : 'size-4'\n )}\n />","<span\n data-slot=\"native-select-wrapper\"\n class={cn('relative inline-flex min-w-0', local.wrapperClass)}\n >\n <select\n ref={(element: HTMLSelectElement) => {\n select = element\n }}\n data-slot=\"native-select\"\n id={field?.id ?? local.id}\n aria-label={local['aria-label']}\n aria-labelledby={field?.['aria-labelledby'] ?? local['aria-labelledby']}\n aria-describedby={field?.['aria-describedby'] ?? local['aria-describedby']}\n aria-invalid={field?.['aria-invalid'] ?? local['aria-invalid']}\n aria-errormessage={field?.['aria-errormessage'] ?? local['aria-errormessage']}\n class={cn(\n 'w-full min-w-0 appearance-none rounded-md border border-input bg-transparent',\n {\n 'h-control-sm px-control-sm pr-8 text-xs': local.size === 'sm',\n 'h-control-md px-control-md pr-9 text-sm':\n local.size === 'md' || local.size === undefined,\n 'h-control-lg px-control-lg pr-9 text-sm': local.size === 'lg',\n },\n 'transition-[color,box-shadow,border-color] ease-out outline-none',\n 'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle',\n 'aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive-subtle',\n 'disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 dark:bg-input/30',\n local.class\n )}\n {...rest}\n >\n <Show when={local.options} fallback={local.children}>\n {(options) => (\n <For each={options()}>\n {(option) => (\n <option\n value={option.value}\n disabled={option.disabled}\n selected={isControlledOptionSelected(\n rest.value,\n option.value,\n Boolean(rest.multiple)\n )}\n >\n {option.label}\n </option>\n )}\n </For>\n )}\n </Show>\n </select>\n <ChevronDownIcon\n data-slot=\"native-select-icon\"\n aria-hidden=\"true\"\n class={cn(\n 'pointer-events-none absolute end-2 top-1/2 -translate-y-1/2 text-muted-foreground',\n local.size === 'sm' ? 'size-3.5' : 'size-4'\n )}\n />\n </span>","ChevronDownIcon","LucideChevronDownIcon","_$setAttribute","_$readShallow"],"sources":["../../../../src/components/ui/native-select/native-select.tsx"],"sourcesContent":["import { ChevronDownIcon as LucideChevronDownIcon } from '@lucide/solid'\nimport type { ComponentProps } from '@solidjs/web'\nimport { createEffect, For, Show, omit } from 'solid-js'\nimport { useFormFieldControl } from '#lib/form-field'\nimport { cn } from '#lib/utils'\nimport { fastIcon } from '#lib/fast-icon'\n\n// lucide icons drawn from a cloned template (see fastIcon).\nconst ChevronDownIcon = fastIcon(LucideChevronDownIcon)\n\nexport type NativeSelectProps = Omit<ComponentProps<'select'>, 'size'> & {\n /**\n * The control rung, matching `Input` and `SelectTrigger`: `sm` for a dense\n * toolbar or pane filter, `md` (the default) everywhere else. This replaces the\n * native `size` attribute, which turns a select into a list box, a different\n * control that this styled single-line select is not.\n */\n size?: 'sm' | 'md' | 'lg'\n /**\n * Layout classes for the element that wraps the select and its chevron: a\n * width or `max-w-*`, `flex-1`, `col-span-*`, a margin. `class` reaches the\n * `<select>` itself, which is the wrong box for any of those, because the\n * wrapper is what a flex or grid parent lays out. The select fills the\n * wrapper, so the chevron stays at the control's edge at any width.\n */\n wrapperClass?: string\n /** Render the choices from data instead of raw option children. */\n options?: readonly NativeSelectOption[]\n /** Initialize an uncontrolled selection after its native options mount. */\n defaultValue?: ComponentProps<'select'>['value']\n}\n\nfunction setSelectedValue(\n select: HTMLSelectElement,\n value: ComponentProps<'select'>['value'],\n multiple: boolean\n) {\n if (value === undefined) return\n\n if (multiple && Array.isArray(value)) {\n const selected = new Set(value.map(String))\n for (const option of select.options) option.selected = selected.has(option.value)\n return\n }\n\n select.value = String(Array.isArray(value) ? (value[0] ?? '') : value)\n}\n\nfunction isControlledOptionSelected(\n value: ComponentProps<'select'>['value'],\n option: string,\n multiple: boolean\n): boolean | undefined {\n if (value === undefined) return undefined\n if (multiple && Array.isArray(value)) return value.some((item) => String(item) === option)\n return String(Array.isArray(value) ? (value[0] ?? '') : value) === option\n}\n\nfunction initializeDefaultSelection(\n select: HTMLSelectElement,\n value: ComponentProps<'select'>['value'],\n multiple: boolean\n) {\n if (value === undefined) return\n\n const defaultValues =\n multiple && Array.isArray(value)\n ? new Set(value.map(String))\n : new Set([String(Array.isArray(value) ? (value[0] ?? '') : value)])\n\n for (const option of select.options) option.defaultSelected = defaultValues.has(option.value)\n setSelectedValue(select, value, multiple)\n}\n\n/**\n * NativeSelect.\n *\n * A styled native `<select>` for compact, finite choices. Use `Select` when the\n * list needs a custom popover, typed options, or runtime filtering; this keeps\n * the browser's built-in keyboard, form, option, and label behavior.\n *\n * Translated from shadcn/ui's MIT-licensed NativeSelect wrapper to SolidJS and\n * the Adea token system; see the root NOTICE for source and attribution.\n */\nexport type NativeSelectOption = Readonly<{\n value: string\n label: string\n disabled?: boolean\n}>\n\nexport function NativeSelect(props: NativeSelectProps) {\n const local = props\n const rest = omit(\n props,\n 'class',\n 'wrapperClass',\n 'size',\n 'children',\n 'defaultValue',\n 'options',\n 'id',\n 'aria-label',\n 'aria-labelledby',\n 'aria-describedby',\n 'aria-invalid',\n 'aria-errormessage'\n )\n const field = useFormFieldControl('control', local)\n let select: HTMLSelectElement | undefined\n\n // Set selection after native options exist; setting select.value before its\n // children are mounted makes browsers fall back to the first option.\n // Replacing option objects rebuilds native options even when value is unchanged.\n // Reapply the controlled value after that render rather than accepting the\n // browser's first enabled option as an implicit selection.\n // An uncontrolled select takes `defaultValue` once, on the first apply. The\n // props are read in the compute: a caller's conditional expression compiles\n // to a getter that creates a memo, which an apply phase or `onSettled` may not.\n let defaultApplied = false\n createEffect(\n () => ({\n options: local.options,\n value: rest.value,\n multiple: Boolean(rest.multiple),\n defaultValue: local.defaultValue,\n }),\n ({ value, multiple, defaultValue }) => {\n if (!select) return\n setSelectedValue(select, value, multiple)\n if (!defaultApplied && value === undefined)\n initializeDefaultSelection(select, defaultValue, multiple)\n defaultApplied = true\n }\n )\n\n return (\n <span\n data-slot=\"native-select-wrapper\"\n class={cn('relative inline-flex min-w-0', local.wrapperClass)}\n >\n <select\n ref={(element: HTMLSelectElement) => {\n select = element\n }}\n data-slot=\"native-select\"\n id={field?.id ?? local.id}\n aria-label={local['aria-label']}\n aria-labelledby={field?.['aria-labelledby'] ?? local['aria-labelledby']}\n aria-describedby={field?.['aria-describedby'] ?? local['aria-describedby']}\n aria-invalid={field?.['aria-invalid'] ?? local['aria-invalid']}\n aria-errormessage={field?.['aria-errormessage'] ?? local['aria-errormessage']}\n class={cn(\n 'w-full min-w-0 appearance-none rounded-md border border-input bg-transparent',\n {\n 'h-control-sm px-control-sm pr-8 text-xs': local.size === 'sm',\n 'h-control-md px-control-md pr-9 text-sm':\n local.size === 'md' || local.size === undefined,\n 'h-control-lg px-control-lg pr-9 text-sm': local.size === 'lg',\n },\n 'transition-[color,box-shadow,border-color] ease-out outline-none',\n 'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle',\n 'aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive-subtle',\n 'disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 dark:bg-input/30',\n local.class\n )}\n {...rest}\n >\n <Show when={local.options} fallback={local.children}>\n {(options) => (\n <For each={options()}>\n {(option) => (\n <option\n value={option.value}\n disabled={option.disabled}\n selected={isControlledOptionSelected(\n rest.value,\n option.value,\n Boolean(rest.multiple)\n )}\n >\n {option.label}\n </option>\n )}\n </For>\n )}\n </Show>\n </select>\n <ChevronDownIcon\n data-slot=\"native-select-icon\"\n aria-hidden=\"true\"\n class={cn(\n 'pointer-events-none absolute end-2 top-1/2 -translate-y-1/2 text-muted-foreground',\n local.size === 'sm' ? 'size-3.5' : 'size-4'\n )}\n />\n </span>\n )\n}\n"],"mappings":";;;;;;;;;AAQA,IAAMQ,oBAAkB,SAASC,eAAqB;AAwBtD,SAAS,iBACP,QACA,OACA,UACA;CACA,IAAI,UAAU,KAAA,GAAW;CAEzB,IAAI,YAAY,MAAM,QAAQ,KAAK,GAAG;EACpC,MAAM,WAAW,IAAI,IAAI,MAAM,IAAI,MAAM,CAAC;EAC1C,KAAK,MAAM,UAAU,OAAO,SAAS,OAAO,WAAW,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OAAA,YAAA,CAAyB;KACzB,CAAA,MAAA,KAAA,KAAA,CAAA,OAAA,MAAA,WAAA;IAFmB,CAAA;IADrB,OAAA;GAUQ,EAAA,CAAA;EAEP,CAAA;CAEH,CAAA,CACA;CAlDV,OAAA,MAmDEJ,gBAAAA,mBAAAA;EACE,aAAU;EACV,eAAY;EACZ,IAAA,UAAA;GAAO,OAAA,GACL,qFACA,MAAM,SAAS,OAAO,aAAa,QACrC;EAAC;CACF,CAAA,GA1DH,IA2DM;CAzDJ,aAAAK,YAAO,GAAG,gCAAgC,MAAM,YAAY,CAAC,IAA7D,KAAA,QAAA;EAA6D,UAAA,MAAA,KAAA,GAAA;;CAHjE,OACEJ;AA6DJ"}
1
+ {"version":3,"file":"native-select.js","names":["ref={(element: HTMLSelectElement) => {\n select = element\n }}","<Show when={local.options} fallback={local.children}>\n {(options) => (\n <For each={options()}>\n {(option) => (\n <option\n value={option.value}\n disabled={option.disabled}\n selected={isControlledOptionSelected(\n rest.value,\n option.value,\n Boolean(rest.multiple)\n )}\n >\n {option.label}\n </option>\n )}\n </For>\n )}\n </Show>","<For each={options()}>\n {(option) => (\n <option\n value={option.value}\n disabled={option.disabled}\n selected={isControlledOptionSelected(\n rest.value,\n option.value,\n Boolean(rest.multiple)\n )}\n >\n {option.label}\n </option>\n )}\n </For>","disabled={option.disabled}","selected={isControlledOptionSelected(\n rest.value,\n option.value,\n Boolean(rest.multiple)\n )}","value={option.value}","<ChevronDownIcon\n data-slot=\"native-select-icon\"\n aria-hidden=\"true\"\n class={cn(\n 'pointer-events-none absolute end-2 top-1/2 -translate-y-1/2 text-muted-foreground',\n local.size === 'sm' ? 'size-3.5' : 'size-4'\n )}\n />","<span\n data-slot=\"native-select-wrapper\"\n class={cn('relative inline-flex min-w-0', local.wrapperClass)}\n >\n <select\n ref={(element: HTMLSelectElement) => {\n select = element\n }}\n data-slot=\"native-select\"\n id={field?.id ?? local.id}\n aria-label={local['aria-label']}\n aria-labelledby={field?.['aria-labelledby'] ?? local['aria-labelledby']}\n aria-describedby={field?.['aria-describedby'] ?? local['aria-describedby']}\n aria-invalid={field?.['aria-invalid'] ?? local['aria-invalid']}\n aria-errormessage={field?.['aria-errormessage'] ?? local['aria-errormessage']}\n class={cn(\n 'w-full min-w-0 appearance-none rounded-md border border-input bg-transparent',\n {\n 'h-control-sm px-control-sm pr-8 text-xs': local.size === 'sm',\n 'h-control-md px-control-md pr-9 text-sm':\n local.size === 'md' || local.size === undefined,\n 'h-control-lg px-control-lg pr-9 text-sm': local.size === 'lg',\n },\n 'transition-[color,box-shadow,border-color] ease-out outline-none',\n 'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle',\n 'aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive-subtle',\n 'disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 dark:bg-input/30',\n local.class\n )}\n {...rest}\n >\n <Show when={local.options} fallback={local.children}>\n {(options) => (\n <For each={options()}>\n {(option) => (\n <option\n value={option.value}\n disabled={option.disabled}\n selected={isControlledOptionSelected(\n rest.value,\n option.value,\n Boolean(rest.multiple)\n )}\n >\n {option.label}\n </option>\n )}\n </For>\n )}\n </Show>\n </select>\n <ChevronDownIcon\n data-slot=\"native-select-icon\"\n aria-hidden=\"true\"\n class={cn(\n 'pointer-events-none absolute end-2 top-1/2 -translate-y-1/2 text-muted-foreground',\n local.size === 'sm' ? 'size-3.5' : 'size-4'\n )}\n />\n </span>","LucideChevronDownIcon","_$spread","_$ref","_$insert","_$effect","_$setAttribute","_$readShallow","_$className"],"sources":["../../../../src/components/ui/native-select/native-select.tsx"],"sourcesContent":["import { ChevronDownIcon as LucideChevronDownIcon } from '@lucide/solid'\nimport type { ComponentProps } from '@solidjs/web'\nimport { createEffect, For, Show, omit } from 'solid-js'\nimport { useFormFieldControl } from '#lib/form-field'\nimport { cn } from '#lib/utils'\nimport { fastIcon } from '#lib/fast-icon'\n\n// lucide icons drawn from a cloned template (see fastIcon).\nconst ChevronDownIcon = fastIcon(LucideChevronDownIcon)\n\nexport type NativeSelectProps = Omit<ComponentProps<'select'>, 'size'> & {\n /**\n * The control rung, matching `Input` and `SelectTrigger`: `sm` for a dense\n * toolbar or pane filter, `md` (the default) everywhere else. This replaces the\n * native `size` attribute, which turns a select into a list box, a different\n * control that this styled single-line select is not.\n */\n size?: 'sm' | 'md' | 'lg'\n /**\n * Layout classes for the element that wraps the select and its chevron: a\n * width or `max-w-*`, `flex-1`, `col-span-*`, a margin. `class` reaches the\n * `<select>` itself, which is the wrong box for any of those, because the\n * wrapper is what a flex or grid parent lays out. The select fills the\n * wrapper, so the chevron stays at the control's edge at any width.\n */\n wrapperClass?: string\n /** Render the choices from data instead of raw option children. */\n options?: readonly NativeSelectOption[]\n /** Initialize an uncontrolled selection after its native options mount. */\n defaultValue?: ComponentProps<'select'>['value']\n}\n\nfunction setSelectedValue(\n select: HTMLSelectElement,\n value: ComponentProps<'select'>['value'],\n multiple: boolean\n) {\n if (value === undefined) return\n\n if (multiple && Array.isArray(value)) {\n const selected = new Set(value.map(String))\n for (const option of select.options) option.selected = selected.has(option.value)\n return\n }\n\n select.value = String(Array.isArray(value) ? (value[0] ?? '') : value)\n}\n\nfunction isControlledOptionSelected(\n value: ComponentProps<'select'>['value'],\n option: string,\n multiple: boolean\n): boolean | undefined {\n if (value === undefined) return undefined\n if (multiple && Array.isArray(value)) return value.some((item) => String(item) === option)\n return String(Array.isArray(value) ? (value[0] ?? '') : value) === option\n}\n\nfunction initializeDefaultSelection(\n select: HTMLSelectElement,\n value: ComponentProps<'select'>['value'],\n multiple: boolean\n) {\n if (value === undefined) return\n\n const defaultValues =\n multiple && Array.isArray(value)\n ? new Set(value.map(String))\n : new Set([String(Array.isArray(value) ? (value[0] ?? '') : value)])\n\n for (const option of select.options) option.defaultSelected = defaultValues.has(option.value)\n setSelectedValue(select, value, multiple)\n}\n\n/**\n * NativeSelect.\n *\n * A styled native `<select>` for compact, finite choices. Use `Select` when the\n * list needs a custom popover, typed options, or runtime filtering; this keeps\n * the browser's built-in keyboard, form, option, and label behavior.\n *\n * Translated from shadcn/ui's MIT-licensed NativeSelect wrapper to SolidJS and\n * the Adea token system; see the root NOTICE for source and attribution.\n */\nexport type NativeSelectOption = Readonly<{\n value: string\n label: string\n disabled?: boolean\n}>\n\nexport function NativeSelect(props: NativeSelectProps) {\n const local = props\n const rest = omit(\n props,\n 'class',\n 'wrapperClass',\n 'size',\n 'children',\n 'defaultValue',\n 'options',\n 'id',\n 'aria-label',\n 'aria-labelledby',\n 'aria-describedby',\n 'aria-invalid',\n 'aria-errormessage'\n )\n const field = useFormFieldControl('control', local)\n let select: HTMLSelectElement | undefined\n\n // Set selection after native options exist; setting select.value before its\n // children are mounted makes browsers fall back to the first option.\n // Replacing option objects rebuilds native options even when value is unchanged.\n // Reapply the controlled value after that render rather than accepting the\n // browser's first enabled option as an implicit selection.\n // An uncontrolled select takes `defaultValue` once, on the first apply. The\n // props are read in the compute: a caller's conditional expression compiles\n // to a getter that creates a memo, which an apply phase or `onSettled` may not.\n let defaultApplied = false\n createEffect(\n () => ({\n options: local.options,\n value: rest.value,\n multiple: Boolean(rest.multiple),\n defaultValue: local.defaultValue,\n }),\n ({ value, multiple, defaultValue }) => {\n if (!select) return\n setSelectedValue(select, value, multiple)\n if (!defaultApplied && value === undefined)\n initializeDefaultSelection(select, defaultValue, multiple)\n defaultApplied = true\n }\n )\n\n return (\n <span\n data-slot=\"native-select-wrapper\"\n class={cn('relative inline-flex min-w-0', local.wrapperClass)}\n >\n <select\n ref={(element: HTMLSelectElement) => {\n select = element\n }}\n data-slot=\"native-select\"\n id={field?.id ?? local.id}\n aria-label={local['aria-label']}\n aria-labelledby={field?.['aria-labelledby'] ?? local['aria-labelledby']}\n aria-describedby={field?.['aria-describedby'] ?? local['aria-describedby']}\n aria-invalid={field?.['aria-invalid'] ?? local['aria-invalid']}\n aria-errormessage={field?.['aria-errormessage'] ?? local['aria-errormessage']}\n class={cn(\n 'w-full min-w-0 appearance-none rounded-md border border-input bg-transparent',\n {\n 'h-control-sm px-control-sm pr-8 text-xs': local.size === 'sm',\n 'h-control-md px-control-md pr-9 text-sm':\n local.size === 'md' || local.size === undefined,\n 'h-control-lg px-control-lg pr-9 text-sm': local.size === 'lg',\n },\n 'transition-[color,box-shadow,border-color] ease-out outline-none',\n 'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle',\n 'aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive-subtle',\n 'disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 dark:bg-input/30',\n local.class\n )}\n {...rest}\n >\n <Show when={local.options} fallback={local.children}>\n {(options) => (\n <For each={options()}>\n {(option) => (\n <option\n value={option.value}\n disabled={option.disabled}\n selected={isControlledOptionSelected(\n rest.value,\n option.value,\n Boolean(rest.multiple)\n )}\n >\n {option.label}\n </option>\n )}\n </For>\n )}\n </Show>\n </select>\n <ChevronDownIcon\n data-slot=\"native-select-icon\"\n aria-hidden=\"true\"\n class={cn(\n 'pointer-events-none absolute end-2 top-1/2 -translate-y-1/2 text-muted-foreground',\n local.size === 'sm' ? 'size-3.5' : 'size-4'\n )}\n />\n </span>\n )\n}\n"],"mappings":";;;;;;;;;AAQA,IAAM,kBAAkB,SAASQ,iBAAqB;AAwBtD,SAAS,iBACP,QACA,OACA,UACA;CACA,IAAI,UAAU,KAAA,GAAW;CAEzB,IAAI,YAAY,MAAM,QAAQ,KAAK,GAAG;EACpC,MAAM,WAAW,IAAI,IAAI,MAAM,IAAI,MAAM,CAAC;EAC1C,KAAK,MAAM,UAAU,OAAO,SAAS,OAAO,WAAW,SAAS,IAAI,OAAO,KAAK;EAChF;CACF;CAEA,OAAO,QAAQ,OAAO,MAAM,QAAQ,KAAK,IAAK,MAAM,MAAM,KAAM,KAAK;AACvE;AAEA,SAAS,2BACP,OACA,QACA,UACqB;CACrB,IAAI,UAAU,KAAA,GAAW,OAAO,KAAA;CAChC,IAAI,YAAY,MAAM,QAAQ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IAAA,UAAA;GAAO,OAAA,GACL,qFACA,MAAM,SAAS,OAAO,aAAa,QACrC;EAAC;CACF,CAAA,GA1DH,IA2DM;CAzDJM,aAAAE,YAAO,GAAG,gCAAgC,MAAM,YAAY,CAAC,IAA7D,KAAA,QAAA;EAA6DC,UAAA,MAAA,KAAA,GAAA;;CAHjE,OACER;AA6DJ"}
@@ -1,11 +1,11 @@
1
+ import { className, createComponent, effect, insert, memo, mergeProps, readShallow, spread, template } from "@solidjs/web";
2
+ import { children, createContext, createSignal, createUniqueId, omit, useContext } from "solid-js";
3
+ import { NavigationMenu as NavigationMenu$1, NavigationMenuContent as NavigationMenuContent$1, NavigationMenuItem as NavigationMenuItem$1, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger as NavigationMenuTrigger$1, NavigationMenuViewport as NavigationMenuViewport$1 } from "@ui-sdk/solid/navigation-menu";
4
+ import { ChevronDown as ChevronDown$1 } from "@lucide/solid";
1
5
  import { callHandler } from "../../../lib/events.js";
2
6
  import { cn } from "../../../lib/utils.js";
3
7
  import { menuItem, menuLabel, menuSeparator, overlayMotion, overlaySurface } from "../../../lib/overlay.js";
4
8
  import { fastIcon } from "../../../lib/fast-icon.js";
5
- import { className, createComponent, effect, insert, memo, mergeProps, readShallow, spread, template } from "@solidjs/web";
6
- import { ChevronDown } from "@lucide/solid";
7
- import { children, createContext, createSignal, createUniqueId, omit, useContext } from "solid-js";
8
- import { NavigationMenu, NavigationMenuContent, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuTrigger, NavigationMenuViewport } from "@ui-sdk/solid/navigation-menu";
9
9
  // src/components/ui/navigation-menu/navigation-menu.tsx
10
10
  var _tmpl$ = /* @__PURE__ */ template(`<button>`);
11
11
  var _tmpl$2 = /* @__PURE__ */ template(`<div>`);
@@ -13,10 +13,10 @@ var _tmpl$3 = /* @__PURE__ */ template(`<span class=font-medium>`);
13
13
  var _tmpl$4 = /* @__PURE__ */ template(`<a>`);
14
14
  var _tmpl$5 = /* @__PURE__ */ template(`<span>`);
15
15
  var _tmpl$6 = /* @__PURE__ */ template(`<hr>`);
16
- var ChevronDown$1 = fastIcon(ChevronDown);
17
- function NavigationMenu$1(props) {
16
+ var ChevronDown = fastIcon(ChevronDown$1);
17
+ function NavigationMenu(props) {
18
18
  const rest = omit(props, "label", "class", "children", "value", "defaultValue", "onValueChange", "orientation", "delayDuration", "openOnHover");
19
- return createComponent(NavigationMenu, mergeProps(rest, {
19
+ return createComponent(NavigationMenu$1, mergeProps(rest, {
20
20
  get value() {
21
21
  return memo(() => {
22
22
  return props.value === void 0;
@@ -47,18 +47,18 @@ function NavigationMenu$1(props) {
47
47
  get children() {
48
48
  return props.children;
49
49
  }
50
- }), createComponent(NavigationMenuViewport$1, {})];
50
+ }), createComponent(NavigationMenuViewport, {})];
51
51
  }
52
52
  }));
53
53
  }
54
54
  /** One top-level entry: the bar's `<li>`, holding a trigger and its panel. */
55
55
  function NavigationMenuMenu(props) {
56
- return createComponent(NavigationMenuItem, props);
56
+ return createComponent(NavigationMenuItem$1, props);
57
57
  }
58
- function NavigationMenuTrigger$1(props) {
58
+ function NavigationMenuTrigger(props) {
59
59
  const [focused, setFocused] = createSignal(false);
60
60
  const rest = omit(props, "class", "children", "onFocus", "onBlur");
61
- return createComponent(NavigationMenuTrigger, mergeProps(rest, {
61
+ return createComponent(NavigationMenuTrigger$1, mergeProps(rest, {
62
62
  onFocus: (event) => {
63
63
  setFocused(true);
64
64
  callHandler(props.onFocus, event);
@@ -85,16 +85,16 @@ function NavigationMenuTrigger$1(props) {
85
85
  get children() {
86
86
  return [memo(() => {
87
87
  return props.children;
88
- }), createComponent(ChevronDown$1, {
88
+ }), createComponent(ChevronDown, {
89
89
  "aria-hidden": "true",
90
90
  class: "size-3.5 transition-transform duration-200 ease-out [[data-expanded]_&]:rotate-180"
91
91
  })];
92
92
  }
93
93
  }));
94
94
  }
95
- function NavigationMenuContent$1(props) {
95
+ function NavigationMenuContent(props) {
96
96
  const rest = omit(props, "class", "children");
97
- return createComponent(NavigationMenuContent, mergeProps(rest, {
97
+ return createComponent(NavigationMenuContent$1, mergeProps(rest, {
98
98
  render: (part, state) => (() => {
99
99
  var _el$2 = _tmpl$2();
100
100
  spread(_el$2, [part, { get "data-expanded"() {
@@ -120,16 +120,16 @@ function NavigationMenuContent$1(props) {
120
120
  * keeps the border outside that measured size so a panel is never clipped by
121
121
  * its own frame.
122
122
  */
123
- function NavigationMenuViewport$1(props) {
123
+ function NavigationMenuViewport(props) {
124
124
  const rest = omit(props, "class");
125
- return createComponent(NavigationMenuViewport, mergeProps({ sideOffset: 6 }, rest, {
125
+ return createComponent(NavigationMenuViewport$1, mergeProps({ sideOffset: 6 }, rest, {
126
126
  "data-slot": "navigation-menu-viewport",
127
127
  get "class"() {
128
128
  return cn(overlaySurface, "isolate z-(--z-menu) box-content list-none overflow-hidden", "h-(--viewport-height) w-(--viewport-width)", "origin-(--transform-origin) transition-[width,height] duration-200 ease-out", props.class);
129
129
  }
130
130
  }));
131
131
  }
132
- function NavigationMenuItem$1(props) {
132
+ function NavigationMenuItem(props) {
133
133
  const [highlighted, setHighlighted] = createSignal(false);
134
134
  const rest = omit(props, "class", "children", "description", "icon", "onFocus", "onBlur", "onPointerEnter", "onPointerLeave");
135
135
  const icon = children(() => props.icon);
@@ -238,6 +238,6 @@ function NavigationMenuGroup(props) {
238
238
  }
239
239
  });
240
240
  }
241
- export { NavigationMenu$1 as NavigationMenu, NavigationMenuContent$1 as NavigationMenuContent, NavigationMenuGroup, NavigationMenuGroupLabel, NavigationMenuItem$1 as NavigationMenuItem, NavigationMenuMenu, NavigationMenuSeparator, NavigationMenuTrigger$1 as NavigationMenuTrigger, NavigationMenuViewport$1 as NavigationMenuViewport };
241
+ export { NavigationMenu, NavigationMenuContent, NavigationMenuGroup, NavigationMenuGroupLabel, NavigationMenuItem, NavigationMenuMenu, NavigationMenuSeparator, NavigationMenuTrigger, NavigationMenuViewport };
242
242
 
243
243
  //# sourceMappingURL=navigation-menu.js.map