@adea-ai/ui 0.151.12 → 0.151.14

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 (961) hide show
  1. package/dist/NOTICE +3 -2
  2. package/dist/components/composites/about-dialog/about-dialog.d.ts.map +1 -1
  3. package/dist/components/composites/about-dialog/about-dialog.js +27 -48
  4. package/dist/components/composites/about-dialog/about-dialog.js.map +1 -1
  5. package/dist/components/composites/account-menu/account-menu.d.ts +2 -2
  6. package/dist/components/composites/account-menu/account-menu.d.ts.map +1 -1
  7. package/dist/components/composites/account-menu/account-menu.js +4 -22
  8. package/dist/components/composites/account-menu/account-menu.js.map +1 -1
  9. package/dist/components/composites/action-button/action-button.d.ts.map +1 -1
  10. package/dist/components/composites/action-button/action-button.js +2 -4
  11. package/dist/components/composites/action-button/action-button.js.map +1 -1
  12. package/dist/components/composites/appearance-editor/accent-swatch-groups.d.ts +1 -10
  13. package/dist/components/composites/appearance-editor/accent-swatch-groups.d.ts.map +1 -1
  14. package/dist/components/composites/appearance-editor/accent-swatch-groups.js +2 -1
  15. package/dist/components/composites/appearance-editor/accent-swatch-groups.js.map +1 -1
  16. package/dist/components/composites/appearance-editor/appearance-choices.d.ts.map +1 -1
  17. package/dist/components/composites/appearance-editor/appearance-choices.js +3 -2
  18. package/dist/components/composites/appearance-editor/appearance-choices.js.map +1 -1
  19. package/dist/components/composites/appearance-editor/appearance-editor.d.ts.map +1 -1
  20. package/dist/components/composites/appearance-editor/appearance-editor.js +1 -0
  21. package/dist/components/composites/appearance-editor/appearance-editor.js.map +1 -1
  22. package/dist/components/composites/appearance-editor/appearance-rows.d.ts.map +1 -1
  23. package/dist/components/composites/appearance-editor/appearance-rows.js +12 -50
  24. package/dist/components/composites/appearance-editor/appearance-rows.js.map +1 -1
  25. package/dist/components/composites/appearance-editor/font-settings-group.d.ts.map +1 -1
  26. package/dist/components/composites/appearance-editor/font-settings-group.js +7 -47
  27. package/dist/components/composites/appearance-editor/font-settings-group.js.map +1 -1
  28. package/dist/components/composites/appearance-editor/index.d.ts +1 -0
  29. package/dist/components/composites/appearance-editor/index.d.ts.map +1 -1
  30. package/dist/components/composites/appearance-editor/index.js +2 -1
  31. package/dist/components/composites/catalog-browser/catalog-browser.d.ts.map +1 -1
  32. package/dist/components/composites/catalog-browser/catalog-browser.js +8 -11
  33. package/dist/components/composites/catalog-browser/catalog-browser.js.map +1 -1
  34. package/dist/components/composites/chain-of-thought/chain-of-thought.d.ts +5 -4
  35. package/dist/components/composites/chain-of-thought/chain-of-thought.d.ts.map +1 -1
  36. package/dist/components/composites/chain-of-thought/chain-of-thought.js +5 -12
  37. package/dist/components/composites/chain-of-thought/chain-of-thought.js.map +1 -1
  38. package/dist/components/composites/chat/chat.d.ts +2 -2
  39. package/dist/components/composites/chat/chat.d.ts.map +1 -1
  40. package/dist/components/composites/chat/chat.js.map +1 -1
  41. package/dist/components/composites/checkpoint/checkpoint-model.js +1 -1
  42. package/dist/components/composites/checkpoint/checkpoint-model.js.map +1 -1
  43. package/dist/components/composites/checkpoint/checkpoint.js +3 -3
  44. package/dist/components/composites/checkpoint/checkpoint.js.map +1 -1
  45. package/dist/components/composites/confirmation/confirmation-model.d.ts +3 -12
  46. package/dist/components/composites/confirmation/confirmation-model.d.ts.map +1 -1
  47. package/dist/components/composites/confirmation/confirmation-model.js +5 -17
  48. package/dist/components/composites/confirmation/confirmation-model.js.map +1 -1
  49. package/dist/components/composites/confirmation/confirmation.js +1 -1
  50. package/dist/components/composites/confirmation/confirmation.js.map +1 -1
  51. package/dist/components/composites/context/context-model.js +1 -1
  52. package/dist/components/composites/context/context-model.js.map +1 -1
  53. package/dist/components/composites/file-tree/build-file-tree.d.ts +5 -12
  54. package/dist/components/composites/file-tree/build-file-tree.d.ts.map +1 -1
  55. package/dist/components/composites/file-tree/build-file-tree.js +26 -30
  56. package/dist/components/composites/file-tree/build-file-tree.js.map +1 -1
  57. package/dist/components/composites/file-tree/file-tree.d.ts +2 -2
  58. package/dist/components/composites/file-tree/file-tree.d.ts.map +1 -1
  59. package/dist/components/composites/file-tree/file-tree.js +4 -30
  60. package/dist/components/composites/file-tree/file-tree.js.map +1 -1
  61. package/dist/components/composites/file-tree/index.d.ts +2 -1
  62. package/dist/components/composites/file-tree/index.d.ts.map +1 -1
  63. package/dist/components/composites/file-tree/index.js +2 -1
  64. package/dist/components/composites/help-center/help-center.d.ts.map +1 -1
  65. package/dist/components/composites/help-center/help-center.js +9 -20
  66. package/dist/components/composites/help-center/help-center.js.map +1 -1
  67. package/dist/components/composites/icon-picker/icon-picker.d.ts.map +1 -1
  68. package/dist/components/composites/icon-picker/icon-picker.js +7 -11
  69. package/dist/components/composites/icon-picker/icon-picker.js.map +1 -1
  70. package/dist/components/composites/inline-citation/citation.d.ts.map +1 -1
  71. package/dist/components/composites/inline-citation/citation.js +2 -1
  72. package/dist/components/composites/inline-citation/citation.js.map +1 -1
  73. package/dist/components/composites/inline-citation/inline-citation.d.ts.map +1 -1
  74. package/dist/components/composites/inline-citation/inline-citation.js +2 -1
  75. package/dist/components/composites/inline-citation/inline-citation.js.map +1 -1
  76. package/dist/components/composites/message-scroller/message-scroller.d.ts +4 -5
  77. package/dist/components/composites/message-scroller/message-scroller.d.ts.map +1 -1
  78. package/dist/components/composites/message-scroller/message-scroller.js +19 -13
  79. package/dist/components/composites/message-scroller/message-scroller.js.map +1 -1
  80. package/dist/components/composites/message-scroller/scroll-anchor.d.ts +4 -3
  81. package/dist/components/composites/message-scroller/scroll-anchor.d.ts.map +1 -1
  82. package/dist/components/composites/message-scroller/scroll-anchor.js +5 -3
  83. package/dist/components/composites/message-scroller/scroll-anchor.js.map +1 -1
  84. package/dist/components/composites/model-selector/model-selector.d.ts.map +1 -1
  85. package/dist/components/composites/model-selector/model-selector.js +1 -1
  86. package/dist/components/composites/model-selector/model-selector.js.map +1 -1
  87. package/dist/components/composites/model-selector/models.js +1 -1
  88. package/dist/components/composites/model-selector/models.js.map +1 -1
  89. package/dist/components/composites/plan/plan.d.ts.map +1 -1
  90. package/dist/components/composites/plan/plan.js +2 -3
  91. package/dist/components/composites/plan/plan.js.map +1 -1
  92. package/dist/components/composites/queue/queue.d.ts +2 -2
  93. package/dist/components/composites/queue/queue.d.ts.map +1 -1
  94. package/dist/components/composites/queue/queue.js +57 -64
  95. package/dist/components/composites/queue/queue.js.map +1 -1
  96. package/dist/components/composites/reasoning/index.js +3 -1
  97. package/dist/components/composites/reasoning/reasoning.d.ts +2 -3
  98. package/dist/components/composites/reasoning/reasoning.d.ts.map +1 -1
  99. package/dist/components/composites/reasoning/reasoning.js +5 -20
  100. package/dist/components/composites/reasoning/reasoning.js.map +1 -1
  101. package/dist/components/composites/settings/settings-layout.d.ts.map +1 -1
  102. package/dist/components/composites/settings/settings-layout.js +3 -2
  103. package/dist/components/composites/settings/settings-layout.js.map +1 -1
  104. package/dist/components/composites/settings/settings-navigation.d.ts.map +1 -1
  105. package/dist/components/composites/settings/settings-navigation.js +1 -1
  106. package/dist/components/composites/settings/settings-navigation.js.map +1 -1
  107. package/dist/components/composites/sources/index.js +2 -1
  108. package/dist/components/composites/sources/source.d.ts +3 -8
  109. package/dist/components/composites/sources/source.d.ts.map +1 -1
  110. package/dist/components/composites/sources/source.js +5 -30
  111. package/dist/components/composites/sources/source.js.map +1 -1
  112. package/dist/components/composites/sources/sources.js +2 -1
  113. package/dist/components/composites/sources/sources.js.map +1 -1
  114. package/dist/components/composites/stack-trace/stack-trace.d.ts.map +1 -1
  115. package/dist/components/composites/stack-trace/stack-trace.js +3 -12
  116. package/dist/components/composites/stack-trace/stack-trace.js.map +1 -1
  117. package/dist/components/composites/subagent/subagent.d.ts +3 -1
  118. package/dist/components/composites/subagent/subagent.d.ts.map +1 -1
  119. package/dist/components/composites/subagent/subagent.js +5 -17
  120. package/dist/components/composites/subagent/subagent.js.map +1 -1
  121. package/dist/components/composites/suggestion/suggestion.d.ts.map +1 -1
  122. package/dist/components/composites/suggestion/suggestion.js +3 -2
  123. package/dist/components/composites/suggestion/suggestion.js.map +1 -1
  124. package/dist/components/composites/task/task.d.ts +2 -3
  125. package/dist/components/composites/task/task.d.ts.map +1 -1
  126. package/dist/components/composites/task/task.js +49 -109
  127. package/dist/components/composites/task/task.js.map +1 -1
  128. package/dist/components/composites/terminal/terminal-model.d.ts +1 -2
  129. package/dist/components/composites/terminal/terminal-model.d.ts.map +1 -1
  130. package/dist/components/composites/terminal/terminal-model.js +7 -1
  131. package/dist/components/composites/terminal/terminal-model.js.map +1 -1
  132. package/dist/components/composites/terminal/terminal.d.ts.map +1 -1
  133. package/dist/components/composites/terminal/terminal.js +3 -12
  134. package/dist/components/composites/terminal/terminal.js.map +1 -1
  135. package/dist/components/composites/test-results/test-results.d.ts.map +1 -1
  136. package/dist/components/composites/test-results/test-results.js +3 -12
  137. package/dist/components/composites/test-results/test-results.js.map +1 -1
  138. package/dist/components/composites/tool/tool.d.ts +0 -1
  139. package/dist/components/composites/tool/tool.d.ts.map +1 -1
  140. package/dist/components/composites/tool/tool.js +47 -41
  141. package/dist/components/composites/tool/tool.js.map +1 -1
  142. package/dist/components/composites/tree/tree-navigation.d.ts +6 -2
  143. package/dist/components/composites/tree/tree-navigation.d.ts.map +1 -1
  144. package/dist/components/composites/tree/tree-navigation.js +18 -1
  145. package/dist/components/composites/tree/tree-navigation.js.map +1 -1
  146. package/dist/components/composites/tree/tree.d.ts +6 -0
  147. package/dist/components/composites/tree/tree.d.ts.map +1 -1
  148. package/dist/components/composites/tree/tree.js +30 -4
  149. package/dist/components/composites/tree/tree.js.map +1 -1
  150. package/dist/components/composites/update-dialog/channel-control.d.ts.map +1 -1
  151. package/dist/components/composites/update-dialog/channel-control.js +7 -8
  152. package/dist/components/composites/update-dialog/channel-control.js.map +1 -1
  153. package/dist/components/composites/update-dialog/update-dialog.d.ts +2 -26
  154. package/dist/components/composites/update-dialog/update-dialog.d.ts.map +1 -1
  155. package/dist/components/composites/update-dialog/update-dialog.js +47 -125
  156. package/dist/components/composites/update-dialog/update-dialog.js.map +1 -1
  157. package/dist/components/composites/update-dialog/update-model.d.ts +65 -0
  158. package/dist/components/composites/update-dialog/update-model.d.ts.map +1 -0
  159. package/dist/components/composites/update-dialog/update-model.js +75 -0
  160. package/dist/components/composites/update-dialog/update-model.js.map +1 -0
  161. package/dist/components/composites/workspace-mark/workspace-mark.js.map +1 -1
  162. package/dist/components/composites/workspace-switcher/workspace-reorder-dialog.d.ts.map +1 -1
  163. package/dist/components/composites/workspace-switcher/workspace-reorder-dialog.js +3 -16
  164. package/dist/components/composites/workspace-switcher/workspace-reorder-dialog.js.map +1 -1
  165. package/dist/components/composites/workspace-switcher/workspace-switcher.d.ts.map +1 -1
  166. package/dist/components/composites/workspace-switcher/workspace-switcher.js +10 -14
  167. package/dist/components/composites/workspace-switcher/workspace-switcher.js.map +1 -1
  168. package/dist/components/conversation/busy-send-button.d.ts +3 -5
  169. package/dist/components/conversation/busy-send-button.d.ts.map +1 -1
  170. package/dist/components/conversation/busy-send-button.js +4 -15
  171. package/dist/components/conversation/busy-send-button.js.map +1 -1
  172. package/dist/components/conversation/chat-composer.d.ts +1 -1
  173. package/dist/components/conversation/chat-composer.d.ts.map +1 -1
  174. package/dist/components/conversation/chat-composer.js +1 -1
  175. package/dist/components/conversation/chat-composer.js.map +1 -1
  176. package/dist/components/conversation/composer-core.d.ts +35 -0
  177. package/dist/components/conversation/composer-core.d.ts.map +1 -0
  178. package/dist/components/conversation/composer-core.js +68 -0
  179. package/dist/components/conversation/composer-core.js.map +1 -0
  180. package/dist/components/conversation/composer-menu.d.ts +1 -1
  181. package/dist/components/conversation/composer-menu.d.ts.map +1 -1
  182. package/dist/components/conversation/composer-menu.js.map +1 -1
  183. package/dist/components/conversation/conversation-pane.d.ts +4 -1
  184. package/dist/components/conversation/conversation-pane.d.ts.map +1 -1
  185. package/dist/components/conversation/conversation-pane.js +4 -0
  186. package/dist/components/conversation/conversation-pane.js.map +1 -1
  187. package/dist/components/conversation/conversation-surface.d.ts +9 -6
  188. package/dist/components/conversation/conversation-surface.d.ts.map +1 -1
  189. package/dist/components/conversation/conversation-surface.js +7 -5
  190. package/dist/components/conversation/conversation-surface.js.map +1 -1
  191. package/dist/components/conversation/ime-guard.d.ts +1 -0
  192. package/dist/components/conversation/ime-guard.d.ts.map +1 -1
  193. package/dist/components/conversation/ime-guard.js +5 -0
  194. package/dist/components/conversation/ime-guard.js.map +1 -1
  195. package/dist/components/conversation/internal/chat-composer-shell.d.ts.map +1 -1
  196. package/dist/components/conversation/internal/chat-composer-shell.js +16 -50
  197. package/dist/components/conversation/internal/chat-composer-shell.js.map +1 -1
  198. package/dist/components/conversation/message-composer.d.ts +1 -3
  199. package/dist/components/conversation/message-composer.d.ts.map +1 -1
  200. package/dist/components/conversation/message-composer.js +15 -32
  201. package/dist/components/conversation/message-composer.js.map +1 -1
  202. package/dist/components/conversation/message-row.d.ts +10 -11
  203. package/dist/components/conversation/message-row.d.ts.map +1 -1
  204. package/dist/components/conversation/message-row.js +24 -49
  205. package/dist/components/conversation/message-row.js.map +1 -1
  206. package/dist/components/conversation/paste-token-editor.d.ts.map +1 -1
  207. package/dist/components/conversation/paste-token-editor.js +7 -17
  208. package/dist/components/conversation/paste-token-editor.js.map +1 -1
  209. package/dist/components/conversation/paste-tokens.d.ts +10 -1
  210. package/dist/components/conversation/paste-tokens.d.ts.map +1 -1
  211. package/dist/components/conversation/paste-tokens.js +26 -2
  212. package/dist/components/conversation/paste-tokens.js.map +1 -1
  213. package/dist/components/conversation/scroll-follow-core.d.ts +30 -79
  214. package/dist/components/conversation/scroll-follow-core.d.ts.map +1 -1
  215. package/dist/components/conversation/scroll-follow-core.js +65 -54
  216. package/dist/components/conversation/scroll-follow-core.js.map +1 -1
  217. package/dist/components/conversation/scroll-follow.d.ts +5 -1
  218. package/dist/components/conversation/scroll-follow.d.ts.map +1 -1
  219. package/dist/components/conversation/scroll-follow.js +27 -91
  220. package/dist/components/conversation/scroll-follow.js.map +1 -1
  221. package/dist/components/conversation/thread-panel.d.ts +0 -2
  222. package/dist/components/conversation/thread-panel.d.ts.map +1 -1
  223. package/dist/components/conversation/thread-panel.js.map +1 -1
  224. package/dist/components/conversation/transcript-composition.d.ts.map +1 -1
  225. package/dist/components/conversation/transcript-composition.js +4 -16
  226. package/dist/components/conversation/transcript-composition.js.map +1 -1
  227. package/dist/components/conversation/transcript-folding.d.ts +0 -1
  228. package/dist/components/conversation/transcript-folding.d.ts.map +1 -1
  229. package/dist/components/conversation/transcript-folding.js +1 -1
  230. package/dist/components/conversation/transcript-folding.js.map +1 -1
  231. package/dist/components/conversation/transcript-grouping.d.ts +8 -0
  232. package/dist/components/conversation/transcript-grouping.d.ts.map +1 -1
  233. package/dist/components/conversation/transcript-grouping.js +17 -3
  234. package/dist/components/conversation/transcript-grouping.js.map +1 -1
  235. package/dist/components/layout/contextual-sidebar/contextual-sidebar.d.ts.map +1 -1
  236. package/dist/components/layout/contextual-sidebar/contextual-sidebar.js +2 -1
  237. package/dist/components/layout/contextual-sidebar/contextual-sidebar.js.map +1 -1
  238. package/dist/components/layout/contextual-sidebar/mobile-contextual-sidebar.js +1 -1
  239. package/dist/components/layout/contextual-sidebar/mobile-contextual-sidebar.js.map +1 -1
  240. package/dist/components/layout/floating-preview/index.js +2 -2
  241. package/dist/components/layout/floating-preview/model.d.ts +21 -55
  242. package/dist/components/layout/floating-preview/model.d.ts.map +1 -1
  243. package/dist/components/layout/floating-preview/model.js +33 -88
  244. package/dist/components/layout/floating-preview/model.js.map +1 -1
  245. package/dist/components/layout/pixel-resize-handle/pixel-resize-handle.d.ts.map +1 -1
  246. package/dist/components/layout/pixel-resize-handle/pixel-resize-handle.js +11 -5
  247. package/dist/components/layout/pixel-resize-handle/pixel-resize-handle.js.map +1 -1
  248. package/dist/components/layout/shell-top-bar/shell-top-bar.d.ts +2 -12
  249. package/dist/components/layout/shell-top-bar/shell-top-bar.d.ts.map +1 -1
  250. package/dist/components/layout/shell-top-bar/shell-top-bar.js +2 -1
  251. package/dist/components/layout/shell-top-bar/shell-top-bar.js.map +1 -1
  252. package/dist/components/layout/side-rail/side-rail-context.d.ts +0 -1
  253. package/dist/components/layout/side-rail/side-rail-context.d.ts.map +1 -1
  254. package/dist/components/layout/side-rail/side-rail-context.js +2 -8
  255. package/dist/components/layout/side-rail/side-rail-context.js.map +1 -1
  256. package/dist/components/layout/side-rail/side-rail.d.ts +0 -9
  257. package/dist/components/layout/side-rail/side-rail.d.ts.map +1 -1
  258. package/dist/components/layout/side-rail/side-rail.js +148 -128
  259. package/dist/components/layout/side-rail/side-rail.js.map +1 -1
  260. package/dist/components/layout/sidebar-nav/index.d.ts +2 -1
  261. package/dist/components/layout/sidebar-nav/index.d.ts.map +1 -1
  262. package/dist/components/layout/sidebar-nav/index.js +2 -1
  263. package/dist/components/layout/sidebar-nav/sidebar-nav-classes.d.ts +10 -0
  264. package/dist/components/layout/sidebar-nav/sidebar-nav-classes.d.ts.map +1 -0
  265. package/dist/components/layout/sidebar-nav/sidebar-nav-classes.js +18 -0
  266. package/dist/components/layout/sidebar-nav/sidebar-nav-classes.js.map +1 -0
  267. package/dist/components/layout/sidebar-nav/sidebar-nav-resize-handle.d.ts +1 -1
  268. package/dist/components/layout/sidebar-nav/sidebar-nav-resize-handle.d.ts.map +1 -1
  269. package/dist/components/layout/sidebar-nav/sidebar-nav-resize-handle.js.map +1 -1
  270. package/dist/components/layout/sidebar-nav/sidebar-nav.d.ts +5 -9
  271. package/dist/components/layout/sidebar-nav/sidebar-nav.d.ts.map +1 -1
  272. package/dist/components/layout/sidebar-nav/sidebar-nav.js +5 -23
  273. package/dist/components/layout/sidebar-nav/sidebar-nav.js.map +1 -1
  274. package/dist/components/layout/split-layout/geometry.d.ts.map +1 -1
  275. package/dist/components/layout/split-layout/geometry.js +2 -2
  276. package/dist/components/layout/split-layout/geometry.js.map +1 -1
  277. package/dist/components/layout/split-layout/index.js +2 -2
  278. package/dist/components/layout/split-layout/model.d.ts.map +1 -1
  279. package/dist/components/layout/split-layout/model.js +4 -4
  280. package/dist/components/layout/split-layout/model.js.map +1 -1
  281. package/dist/components/layout/split-layout/resize-controller-core-retry.d.ts +5 -0
  282. package/dist/components/layout/split-layout/resize-controller-core-retry.d.ts.map +1 -1
  283. package/dist/components/layout/split-layout/resize-controller-core-retry.js +17 -10
  284. package/dist/components/layout/split-layout/resize-controller-core-retry.js.map +1 -1
  285. package/dist/components/layout/split-layout/resize-controller-core.d.ts +5 -0
  286. package/dist/components/layout/split-layout/resize-controller-core.d.ts.map +1 -1
  287. package/dist/components/layout/split-layout/resize-controller-core.js +17 -10
  288. package/dist/components/layout/split-layout/resize-controller-core.js.map +1 -1
  289. package/dist/components/layout/split-layout/split-layout.d.ts.map +1 -1
  290. package/dist/components/layout/split-layout/split-layout.js +54 -47
  291. package/dist/components/layout/split-layout/split-layout.js.map +1 -1
  292. package/dist/components/layout/split-layout/tree.d.ts +2 -0
  293. package/dist/components/layout/split-layout/tree.d.ts.map +1 -1
  294. package/dist/components/layout/split-layout/tree.js +5 -1
  295. package/dist/components/layout/split-layout/tree.js.map +1 -1
  296. package/dist/components/layout/top-bar/top-bar.d.ts +2 -9
  297. package/dist/components/layout/top-bar/top-bar.d.ts.map +1 -1
  298. package/dist/components/layout/top-bar/top-bar.js +4 -8
  299. package/dist/components/layout/top-bar/top-bar.js.map +1 -1
  300. package/dist/components/layout/top-bar/window-chrome.d.ts +13 -0
  301. package/dist/components/layout/top-bar/window-chrome.d.ts.map +1 -0
  302. package/dist/components/layout/top-bar/window-chrome.js +12 -0
  303. package/dist/components/layout/top-bar/window-chrome.js.map +1 -0
  304. package/dist/components/motion/presence.d.ts +1 -1
  305. package/dist/components/motion/presence.d.ts.map +1 -1
  306. package/dist/components/motion/presence.js +1 -4
  307. package/dist/components/motion/presence.js.map +1 -1
  308. package/dist/components/theme/appearance-panel.d.ts +3 -1
  309. package/dist/components/theme/appearance-panel.d.ts.map +1 -1
  310. package/dist/components/theme/appearance-panel.js +17 -9
  311. package/dist/components/theme/appearance-panel.js.map +1 -1
  312. package/dist/components/theme/index.d.ts +1 -1
  313. package/dist/components/theme/index.d.ts.map +1 -1
  314. package/dist/components/theme/index.js +5 -4
  315. package/dist/components/theme/lazy.d.ts +31 -5
  316. package/dist/components/theme/lazy.d.ts.map +1 -1
  317. package/dist/components/theme/lazy.js +39 -6
  318. package/dist/components/theme/lazy.js.map +1 -0
  319. package/dist/components/theme/script-projection.js +3 -2
  320. package/dist/components/theme/script-projection.js.map +1 -1
  321. package/dist/components/theme/script.js +3 -1
  322. package/dist/components/theme/theme-api.d.ts +14 -0
  323. package/dist/components/theme/theme-api.d.ts.map +1 -0
  324. package/dist/components/theme/theme-catalogue-source.d.ts.map +1 -1
  325. package/dist/components/theme/theme-catalogue-source.js +3 -2
  326. package/dist/components/theme/theme-catalogue-source.js.map +1 -1
  327. package/dist/components/theme/theme-document.d.ts +112 -10
  328. package/dist/components/theme/theme-document.d.ts.map +1 -1
  329. package/dist/components/theme/{theme-document-core.js → theme-document.js} +7 -7
  330. package/dist/components/theme/theme-document.js.map +1 -0
  331. package/dist/components/theme/theme-mode-toggle.d.ts +1 -1
  332. package/dist/components/theme/theme-mode-toggle.d.ts.map +1 -1
  333. package/dist/components/theme/theme-mode-toggle.js.map +1 -1
  334. package/dist/components/theme/theme-persistence.d.ts +6 -5
  335. package/dist/components/theme/theme-persistence.d.ts.map +1 -1
  336. package/dist/components/theme/theme-persistence.js +48 -80
  337. package/dist/components/theme/theme-persistence.js.map +1 -1
  338. package/dist/components/theme/theme-picker.d.ts +1 -1
  339. package/dist/components/theme/theme-picker.d.ts.map +1 -1
  340. package/dist/components/theme/theme-picker.js.map +1 -1
  341. package/dist/components/theme/theme-provider-value.d.ts +14 -15
  342. package/dist/components/theme/theme-provider-value.d.ts.map +1 -1
  343. package/dist/components/theme/theme-provider-value.js +26 -42
  344. package/dist/components/theme/theme-provider-value.js.map +1 -1
  345. package/dist/components/theme/theme-provider.d.ts +3 -9
  346. package/dist/components/theme/theme-provider.d.ts.map +1 -1
  347. package/dist/components/theme/theme-provider.js +8 -7
  348. package/dist/components/theme/theme-provider.js.map +1 -1
  349. package/dist/components/theme/theme-script.d.ts +12 -25
  350. package/dist/components/theme/theme-script.d.ts.map +1 -1
  351. package/dist/components/theme/theme-script.js +35 -38
  352. package/dist/components/theme/theme-script.js.map +1 -1
  353. package/dist/components/theme/theme-state.d.ts +241 -9
  354. package/dist/components/theme/theme-state.d.ts.map +1 -1
  355. package/dist/components/theme/{theme-state-core.js → theme-state.js} +10 -11
  356. package/dist/components/theme/theme-state.js.map +1 -0
  357. package/dist/components/theme/theme-toggle.d.ts +1 -1
  358. package/dist/components/theme/theme-toggle.d.ts.map +1 -1
  359. package/dist/components/theme/theme-toggle.js.map +1 -1
  360. package/dist/components/ui/alert-dialog/alert-dialog.d.ts +7 -5
  361. package/dist/components/ui/alert-dialog/alert-dialog.d.ts.map +1 -1
  362. package/dist/components/ui/alert-dialog/alert-dialog.js +40 -36
  363. package/dist/components/ui/alert-dialog/alert-dialog.js.map +1 -1
  364. package/dist/components/ui/attachment/attachment.d.ts.map +1 -1
  365. package/dist/components/ui/attachment/attachment.js +5 -16
  366. package/dist/components/ui/attachment/attachment.js.map +1 -1
  367. package/dist/components/ui/avatar/avatar.d.ts.map +1 -1
  368. package/dist/components/ui/avatar/avatar.js +5 -2
  369. package/dist/components/ui/avatar/avatar.js.map +1 -1
  370. package/dist/components/ui/board/board.d.ts +0 -3
  371. package/dist/components/ui/board/board.d.ts.map +1 -1
  372. package/dist/components/ui/board/board.js +3 -6
  373. package/dist/components/ui/board/board.js.map +1 -1
  374. package/dist/components/ui/button-group/button-group.d.ts +1 -1
  375. package/dist/components/ui/button-group/button-group.d.ts.map +1 -1
  376. package/dist/components/ui/button-group/button-group.js.map +1 -1
  377. package/dist/components/ui/chart/chart.d.ts +0 -3
  378. package/dist/components/ui/chart/chart.d.ts.map +1 -1
  379. package/dist/components/ui/chart/chart.js.map +1 -1
  380. package/dist/components/ui/code-block/code-block.d.ts +0 -2
  381. package/dist/components/ui/code-block/code-block.d.ts.map +1 -1
  382. package/dist/components/ui/code-block/code-block.js +8 -24
  383. package/dist/components/ui/code-block/code-block.js.map +1 -1
  384. package/dist/components/ui/command/command.d.ts.map +1 -1
  385. package/dist/components/ui/command/command.js +56 -48
  386. package/dist/components/ui/command/command.js.map +1 -1
  387. package/dist/components/ui/context-menu/context-menu.d.ts +8 -30
  388. package/dist/components/ui/context-menu/context-menu.d.ts.map +1 -1
  389. package/dist/components/ui/context-menu/context-menu.js +13 -121
  390. package/dist/components/ui/context-menu/context-menu.js.map +1 -1
  391. package/dist/components/ui/dialog/dialog-layer.d.ts +46 -0
  392. package/dist/components/ui/dialog/dialog-layer.d.ts.map +1 -0
  393. package/dist/components/ui/dialog/dialog-layer.js +169 -0
  394. package/dist/components/ui/dialog/dialog-layer.js.map +1 -0
  395. package/dist/components/ui/dialog/dialog.d.ts +20 -26
  396. package/dist/components/ui/dialog/dialog.d.ts.map +1 -1
  397. package/dist/components/ui/dialog/dialog.js +69 -187
  398. package/dist/components/ui/dialog/dialog.js.map +1 -1
  399. package/dist/components/ui/drawer/drawer.d.ts.map +1 -1
  400. package/dist/components/ui/drawer/drawer.js +5 -8
  401. package/dist/components/ui/drawer/drawer.js.map +1 -1
  402. package/dist/components/ui/dropdown-menu/dropdown-menu.d.ts +39 -53
  403. package/dist/components/ui/dropdown-menu/dropdown-menu.d.ts.map +1 -1
  404. package/dist/components/ui/dropdown-menu/dropdown-menu.js +135 -191
  405. package/dist/components/ui/dropdown-menu/dropdown-menu.js.map +1 -1
  406. package/dist/components/ui/dropdown-menu/menu-parts.d.ts +46 -0
  407. package/dist/components/ui/dropdown-menu/menu-parts.d.ts.map +1 -0
  408. package/dist/components/ui/dropdown-menu/menu-parts.js +176 -0
  409. package/dist/components/ui/dropdown-menu/menu-parts.js.map +1 -0
  410. package/dist/components/ui/field/field.js.map +1 -1
  411. package/dist/components/ui/field/number-field.js.map +1 -1
  412. package/dist/components/ui/hover-card/hover-card.d.ts +1 -2
  413. package/dist/components/ui/hover-card/hover-card.d.ts.map +1 -1
  414. package/dist/components/ui/hover-card/hover-card.js +4 -21
  415. package/dist/components/ui/hover-card/hover-card.js.map +1 -1
  416. package/dist/components/ui/menubar/menubar.d.ts +19 -33
  417. package/dist/components/ui/menubar/menubar.d.ts.map +1 -1
  418. package/dist/components/ui/menubar/menubar.js +21 -116
  419. package/dist/components/ui/menubar/menubar.js.map +1 -1
  420. package/dist/components/ui/message/index.js +2 -1
  421. package/dist/components/ui/message/message.d.ts +0 -1
  422. package/dist/components/ui/message/message.d.ts.map +1 -1
  423. package/dist/components/ui/message/message.js.map +1 -1
  424. package/dist/components/ui/message/parse-message-text.d.ts +20 -2
  425. package/dist/components/ui/message/parse-message-text.d.ts.map +1 -1
  426. package/dist/components/ui/message/parse-message-text.js +94 -28
  427. package/dist/components/ui/message/parse-message-text.js.map +1 -1
  428. package/dist/components/ui/modal-dialog/modal-dialog.d.ts +5 -12
  429. package/dist/components/ui/modal-dialog/modal-dialog.d.ts.map +1 -1
  430. package/dist/components/ui/modal-dialog/modal-dialog.js +61 -77
  431. package/dist/components/ui/modal-dialog/modal-dialog.js.map +1 -1
  432. package/dist/components/ui/navigation-menu/navigation-menu.d.ts +0 -1
  433. package/dist/components/ui/navigation-menu/navigation-menu.d.ts.map +1 -1
  434. package/dist/components/ui/navigation-menu/navigation-menu.js.map +1 -1
  435. package/dist/components/ui/popover/popover.d.ts +1 -3
  436. package/dist/components/ui/popover/popover.d.ts.map +1 -1
  437. package/dist/components/ui/popover/popover.js +1 -22
  438. package/dist/components/ui/popover/popover.js.map +1 -1
  439. package/dist/components/ui/resizable/resizable.d.ts.map +1 -1
  440. package/dist/components/ui/resizable/resizable.js +12 -6
  441. package/dist/components/ui/resizable/resizable.js.map +1 -1
  442. package/dist/components/ui/sheet/sheet.d.ts +4 -6
  443. package/dist/components/ui/sheet/sheet.d.ts.map +1 -1
  444. package/dist/components/ui/sheet/sheet.js +31 -32
  445. package/dist/components/ui/sheet/sheet.js.map +1 -1
  446. package/dist/components/ui/text-link/index.d.ts.map +1 -1
  447. package/dist/components/ui/toggle-group/toggle-group.d.ts +1 -1
  448. package/dist/components/ui/toggle-group/toggle-group.d.ts.map +1 -1
  449. package/dist/components/ui/toggle-group/toggle-group.js +2 -7
  450. package/dist/components/ui/toggle-group/toggle-group.js.map +1 -1
  451. package/dist/components/ui/tooltip/tooltip.d.ts +17 -1
  452. package/dist/components/ui/tooltip/tooltip.d.ts.map +1 -1
  453. package/dist/components/ui/tooltip/tooltip.js +40 -20
  454. package/dist/components/ui/tooltip/tooltip.js.map +1 -1
  455. package/dist/components/ui/trace/index.d.ts +1 -1
  456. package/dist/components/ui/trace/index.d.ts.map +1 -1
  457. package/dist/components/ui/trace/index.js +1 -1
  458. package/dist/components/ui/trace/trace.d.ts +44 -3
  459. package/dist/components/ui/trace/trace.d.ts.map +1 -1
  460. package/dist/components/ui/trace/trace.js +87 -15
  461. package/dist/components/ui/trace/trace.js.map +1 -1
  462. package/dist/index.js +34 -28
  463. package/dist/lib/accent-presets.d.ts +7 -4
  464. package/dist/lib/accent-presets.d.ts.map +1 -1
  465. package/dist/lib/accent-presets.js +10 -5
  466. package/dist/lib/accent-presets.js.map +1 -1
  467. package/dist/lib/accent-roles.d.ts +20 -1
  468. package/dist/lib/accent-roles.d.ts.map +1 -1
  469. package/dist/lib/accent-roles.js +34 -26
  470. package/dist/lib/accent-roles.js.map +1 -1
  471. package/dist/lib/appearance-font-settings.d.ts.map +1 -1
  472. package/dist/lib/appearance-font-settings.js +4 -4
  473. package/dist/lib/appearance-font-settings.js.map +1 -1
  474. package/dist/lib/async-action.d.ts +42 -0
  475. package/dist/lib/async-action.d.ts.map +1 -0
  476. package/dist/lib/async-action.js +61 -0
  477. package/dist/lib/async-action.js.map +1 -0
  478. package/dist/lib/breakpoints.d.ts +8 -0
  479. package/dist/lib/breakpoints.d.ts.map +1 -0
  480. package/dist/lib/breakpoints.js +11 -0
  481. package/dist/lib/breakpoints.js.map +1 -0
  482. package/dist/lib/bytes.d.ts +8 -0
  483. package/dist/lib/bytes.d.ts.map +1 -0
  484. package/dist/lib/bytes.js +20 -0
  485. package/dist/lib/bytes.js.map +1 -0
  486. package/dist/lib/clipboard.d.ts +13 -0
  487. package/dist/lib/clipboard.d.ts.map +1 -1
  488. package/dist/lib/clipboard.js +32 -1
  489. package/dist/lib/clipboard.js.map +1 -1
  490. package/dist/lib/events.d.ts +14 -0
  491. package/dist/lib/events.d.ts.map +1 -0
  492. package/dist/lib/events.js +16 -0
  493. package/dist/lib/events.js.map +1 -0
  494. package/dist/lib/external-link.d.ts +19 -0
  495. package/dist/lib/external-link.d.ts.map +1 -0
  496. package/dist/lib/external-link.js +27 -0
  497. package/dist/lib/external-link.js.map +1 -0
  498. package/dist/lib/font-catalog.d.ts +3 -6
  499. package/dist/lib/font-catalog.d.ts.map +1 -1
  500. package/dist/lib/font-catalog.js +16 -12
  501. package/dist/lib/font-catalog.js.map +1 -1
  502. package/dist/lib/font-zoom.d.ts +4 -4
  503. package/dist/lib/font-zoom.d.ts.map +1 -1
  504. package/dist/lib/font-zoom.js +9 -12
  505. package/dist/lib/font-zoom.js.map +1 -1
  506. package/dist/lib/overlay.d.ts +29 -1
  507. package/dist/lib/overlay.d.ts.map +1 -1
  508. package/dist/lib/overlay.js +32 -16
  509. package/dist/lib/overlay.js.map +1 -1
  510. package/dist/lib/preference-store.d.ts +13 -3
  511. package/dist/lib/preference-store.d.ts.map +1 -1
  512. package/dist/lib/preference-store.js +27 -37
  513. package/dist/lib/preference-store.js.map +1 -1
  514. package/dist/lib/resize-separator.d.ts +15 -0
  515. package/dist/lib/resize-separator.d.ts.map +1 -0
  516. package/dist/lib/resize-separator.js +23 -0
  517. package/dist/lib/resize-separator.js.map +1 -0
  518. package/dist/lib/safe-script.d.ts +19 -1
  519. package/dist/lib/safe-script.d.ts.map +1 -1
  520. package/dist/lib/safe-script.js +19 -1
  521. package/dist/lib/safe-script.js.map +1 -1
  522. package/dist/lib/scroll-geometry.d.ts +33 -0
  523. package/dist/lib/scroll-geometry.d.ts.map +1 -0
  524. package/dist/lib/scroll-geometry.js +48 -0
  525. package/dist/lib/scroll-geometry.js.map +1 -0
  526. package/dist/lib/text.d.ts +13 -0
  527. package/dist/lib/text.d.ts.map +1 -0
  528. package/dist/lib/text.js +30 -0
  529. package/dist/lib/text.js.map +1 -0
  530. package/dist/lib/theme-accents.d.ts +2 -0
  531. package/dist/lib/theme-accents.d.ts.map +1 -1
  532. package/dist/lib/theme-accents.js +2 -2
  533. package/dist/lib/theme-accents.js.map +1 -1
  534. package/dist/lib/theme-catalogue.d.ts.map +1 -1
  535. package/dist/lib/theme-catalogue.js +3 -4
  536. package/dist/lib/theme-catalogue.js.map +1 -1
  537. package/dist/lib/theme-css.d.ts +14 -1
  538. package/dist/lib/theme-css.d.ts.map +1 -1
  539. package/dist/lib/theme-css.js +25 -48
  540. package/dist/lib/theme-css.js.map +1 -1
  541. package/dist/lib/theme-defaults.d.ts +33 -5
  542. package/dist/lib/theme-defaults.d.ts.map +1 -1
  543. package/dist/lib/theme-defaults.generated.d.ts +1 -1
  544. package/dist/lib/theme-defaults.generated.d.ts.map +1 -1
  545. package/dist/lib/theme-defaults.generated.js.map +1 -1
  546. package/dist/lib/theme-defaults.js +59 -3
  547. package/dist/lib/theme-defaults.js.map +1 -1
  548. package/dist/lib/theme-engine-light.d.ts +6 -0
  549. package/dist/lib/theme-engine-light.d.ts.map +1 -1
  550. package/dist/lib/theme-engine-light.js +71 -57
  551. package/dist/lib/theme-engine-light.js.map +1 -1
  552. package/dist/lib/theme-engine.d.ts +20 -22
  553. package/dist/lib/theme-engine.d.ts.map +1 -1
  554. package/dist/lib/theme-engine.js +19 -6
  555. package/dist/lib/theme-engine.js.map +1 -1
  556. package/dist/lib/theme-records.d.ts +3 -3
  557. package/dist/lib/theme-records.d.ts.map +1 -1
  558. package/dist/lib/theme-records.js +20 -59
  559. package/dist/lib/theme-records.js.map +1 -1
  560. package/dist/lib/theme-types.d.ts +174 -0
  561. package/dist/lib/theme-types.d.ts.map +1 -0
  562. package/dist/lib/theme-types.js +105 -0
  563. package/dist/lib/theme-types.js.map +1 -0
  564. package/dist/lib/themes.d.ts +4 -159
  565. package/dist/lib/themes.d.ts.map +1 -1
  566. package/dist/lib/themes.js +14 -33
  567. package/dist/lib/themes.js.map +1 -1
  568. package/dist/lib/tokens.d.ts.map +1 -1
  569. package/dist/lib/tokens.js +0 -1
  570. package/dist/lib/tokens.js.map +1 -1
  571. package/dist/lib/url.d.ts +9 -0
  572. package/dist/lib/url.d.ts.map +1 -0
  573. package/dist/lib/url.js +24 -0
  574. package/dist/lib/url.js.map +1 -0
  575. package/dist/lib/version-notes.d.ts.map +1 -1
  576. package/dist/lib/version-notes.js +3 -10
  577. package/dist/lib/version-notes.js.map +1 -1
  578. package/dist/r/about-dialog.json +2 -1
  579. package/dist/r/action-button.json +2 -1
  580. package/dist/r/alert-dialog.json +1 -0
  581. package/dist/r/checkpoint.json +0 -2
  582. package/dist/r/code-block.json +1 -0
  583. package/dist/r/confirmation.json +0 -1
  584. package/dist/r/context-menu.json +2 -2
  585. package/dist/r/context.json +0 -1
  586. package/dist/r/conversation.json +6 -5
  587. package/dist/r/dialog.json +5 -0
  588. package/dist/r/drawer.json +0 -1
  589. package/dist/r/dropdown-menu.json +5 -0
  590. package/dist/r/lib.json +50 -0
  591. package/dist/r/menubar.json +2 -2
  592. package/dist/r/model-selector.json +0 -1
  593. package/dist/r/reasoning.json +2 -1
  594. package/dist/r/registry.json +102 -43
  595. package/dist/r/shell-top-bar.json +1 -0
  596. package/dist/r/sidebar-nav.json +5 -0
  597. package/dist/r/sources.json +2 -2
  598. package/dist/r/src/components/composites/about-dialog/about-dialog.tsx +22 -42
  599. package/dist/r/src/components/composites/account-menu/account-menu.tsx +9 -35
  600. package/dist/r/src/components/composites/action-button/action-button.tsx +5 -7
  601. package/dist/r/src/components/composites/appearance-editor/accent-swatch-groups.tsx +3 -11
  602. package/dist/r/src/components/composites/appearance-editor/appearance-choices.tsx +8 -5
  603. package/dist/r/src/components/composites/appearance-editor/appearance-editor.tsx +8 -6
  604. package/dist/r/src/components/composites/appearance-editor/appearance-rows.tsx +14 -74
  605. package/dist/r/src/components/composites/appearance-editor/font-settings-group.tsx +11 -77
  606. package/dist/r/src/components/composites/appearance-editor/index.ts +1 -0
  607. package/dist/r/src/components/composites/catalog-browser/catalog-browser.tsx +9 -13
  608. package/dist/r/src/components/composites/chain-of-thought/chain-of-thought.tsx +16 -18
  609. package/dist/r/src/components/composites/chat/chat.tsx +2 -2
  610. package/dist/r/src/components/composites/checkpoint/checkpoint-model.ts +3 -3
  611. package/dist/r/src/components/composites/checkpoint/checkpoint.tsx +3 -3
  612. package/dist/r/src/components/composites/confirmation/confirmation-model.ts +9 -17
  613. package/dist/r/src/components/composites/confirmation/confirmation.tsx +2 -2
  614. package/dist/r/src/components/composites/context/context-model.ts +1 -1
  615. package/dist/r/src/components/composites/file-tree/build-file-tree.ts +21 -39
  616. package/dist/r/src/components/composites/file-tree/file-tree.tsx +5 -58
  617. package/dist/r/src/components/composites/file-tree/index.ts +1 -1
  618. package/dist/r/src/components/composites/help-center/help-center.tsx +8 -21
  619. package/dist/r/src/components/composites/icon-picker/icon-picker.tsx +10 -11
  620. package/dist/r/src/components/composites/inline-citation/citation.ts +2 -1
  621. package/dist/r/src/components/composites/inline-citation/inline-citation.tsx +3 -2
  622. package/dist/r/src/components/composites/message-scroller/message-scroller.tsx +30 -30
  623. package/dist/r/src/components/composites/message-scroller/scroll-anchor.ts +5 -5
  624. package/dist/r/src/components/composites/model-selector/model-selector.tsx +3 -2
  625. package/dist/r/src/components/composites/model-selector/models.ts +1 -1
  626. package/dist/r/src/components/composites/plan/plan.tsx +1 -4
  627. package/dist/r/src/components/composites/queue/queue.tsx +8 -11
  628. package/dist/r/src/components/composites/reasoning/reasoning.tsx +5 -23
  629. package/dist/r/src/components/composites/settings/settings-layout.tsx +3 -2
  630. package/dist/r/src/components/composites/settings/settings-navigation.tsx +4 -1
  631. package/dist/r/src/components/composites/sources/source.ts +7 -53
  632. package/dist/r/src/components/composites/stack-trace/stack-trace.tsx +3 -12
  633. package/dist/r/src/components/composites/subagent/subagent.tsx +7 -17
  634. package/dist/r/src/components/composites/suggestion/suggestion.tsx +4 -3
  635. package/dist/r/src/components/composites/task/task.tsx +21 -64
  636. package/dist/r/src/components/composites/terminal/terminal-model.ts +4 -4
  637. package/dist/r/src/components/composites/terminal/terminal.tsx +3 -12
  638. package/dist/r/src/components/composites/test-results/test-results.tsx +3 -12
  639. package/dist/r/src/components/composites/tool/tool.tsx +34 -40
  640. package/dist/r/src/components/composites/tree/tree-navigation.ts +22 -2
  641. package/dist/r/src/components/composites/tree/tree.tsx +47 -3
  642. package/dist/r/src/components/composites/update-dialog/channel-control.tsx +10 -14
  643. package/dist/r/src/components/composites/update-dialog/update-dialog.tsx +66 -200
  644. package/dist/r/src/components/composites/update-dialog/update-model.ts +137 -0
  645. package/dist/r/src/components/composites/workspace-mark/workspace-mark.tsx +1 -1
  646. package/dist/r/src/components/composites/workspace-switcher/workspace-reorder-dialog.tsx +1 -18
  647. package/dist/r/src/components/composites/workspace-switcher/workspace-switcher.tsx +16 -19
  648. package/dist/r/src/components/conversation/busy-send-button.tsx +7 -34
  649. package/dist/r/src/components/conversation/chat-composer.tsx +1 -1
  650. package/dist/r/src/components/conversation/composer-core.ts +76 -0
  651. package/dist/r/src/components/conversation/composer-menu.tsx +1 -1
  652. package/dist/r/src/components/conversation/conversation-pane.tsx +4 -1
  653. package/dist/r/src/components/conversation/conversation-surface.tsx +23 -10
  654. package/dist/r/src/components/conversation/ime-guard.ts +6 -0
  655. package/dist/r/src/components/conversation/internal/chat-composer-shell.tsx +24 -65
  656. package/dist/r/src/components/conversation/message-composer.tsx +24 -54
  657. package/dist/r/src/components/conversation/message-row.tsx +33 -47
  658. package/dist/r/src/components/conversation/paste-token-editor.tsx +13 -16
  659. package/dist/r/src/components/conversation/paste-tokens.ts +36 -1
  660. package/dist/r/src/components/conversation/scroll-follow-core.ts +66 -137
  661. package/dist/r/src/components/conversation/scroll-follow.ts +26 -67
  662. package/dist/r/src/components/conversation/thread-panel.tsx +2 -4
  663. package/dist/r/src/components/conversation/transcript-composition.tsx +9 -33
  664. package/dist/r/src/components/conversation/transcript-folding.ts +2 -2
  665. package/dist/r/src/components/conversation/transcript-grouping.ts +18 -3
  666. package/dist/r/src/components/layout/contextual-sidebar/contextual-sidebar.tsx +4 -3
  667. package/dist/r/src/components/layout/contextual-sidebar/mobile-contextual-sidebar.tsx +1 -1
  668. package/dist/r/src/components/layout/floating-preview/model.ts +57 -195
  669. package/dist/r/src/components/layout/pixel-resize-handle/pixel-resize-handle.tsx +6 -12
  670. package/dist/r/src/components/layout/shell-top-bar/shell-top-bar.tsx +32 -47
  671. package/dist/r/src/components/layout/side-rail/side-rail-context.ts +1 -11
  672. package/dist/r/src/components/layout/side-rail/side-rail.tsx +95 -107
  673. package/dist/r/src/components/layout/sidebar-nav/index.ts +1 -2
  674. package/dist/r/src/components/layout/sidebar-nav/sidebar-nav-classes.ts +15 -0
  675. package/dist/r/src/components/layout/sidebar-nav/sidebar-nav-resize-handle.tsx +1 -4
  676. package/dist/r/src/components/layout/sidebar-nav/sidebar-nav.tsx +9 -27
  677. package/dist/r/src/components/layout/split-layout/geometry.ts +2 -9
  678. package/dist/r/src/components/layout/split-layout/model.ts +3 -6
  679. package/dist/r/src/components/layout/split-layout/resize-controller-core-retry.tsx +12 -6
  680. package/dist/r/src/components/layout/split-layout/resize-controller-core.tsx +12 -6
  681. package/dist/r/src/components/layout/split-layout/split-layout.tsx +46 -61
  682. package/dist/r/src/components/layout/split-layout/tree.ts +5 -0
  683. package/dist/r/src/components/layout/top-bar/top-bar.tsx +16 -38
  684. package/dist/r/src/components/layout/top-bar/window-chrome.ts +23 -0
  685. package/dist/r/src/components/motion/presence.tsx +1 -3
  686. package/dist/r/src/components/theme/appearance-panel.tsx +28 -19
  687. package/dist/r/src/components/theme/index.ts +1 -22
  688. package/dist/r/src/components/theme/lazy.ts +36 -26
  689. package/dist/r/src/components/theme/theme-api.ts +30 -0
  690. package/dist/r/src/components/theme/theme-catalogue-source.ts +3 -2
  691. package/dist/r/src/components/theme/theme-document.ts +248 -23
  692. package/dist/r/src/components/theme/theme-mode-toggle.tsx +1 -1
  693. package/dist/r/src/components/theme/theme-persistence.ts +74 -130
  694. package/dist/r/src/components/theme/theme-picker.tsx +2 -2
  695. package/dist/r/src/components/theme/theme-provider-value.ts +53 -68
  696. package/dist/r/src/components/theme/theme-provider.tsx +5 -24
  697. package/dist/r/src/components/theme/theme-script.ts +48 -43
  698. package/dist/r/src/components/theme/theme-state.ts +350 -10
  699. package/dist/r/src/components/theme/theme-toggle.tsx +1 -1
  700. package/dist/r/src/components/ui/alert-dialog/alert-dialog.tsx +43 -43
  701. package/dist/r/src/components/ui/attachment/attachment.tsx +4 -17
  702. package/dist/r/src/components/ui/avatar/avatar.tsx +3 -2
  703. package/dist/r/src/components/ui/board/board.tsx +4 -10
  704. package/dist/r/src/components/ui/button-group/button-group.tsx +1 -1
  705. package/dist/r/src/components/ui/chart/chart.tsx +0 -3
  706. package/dist/r/src/components/ui/code-block/code-block.tsx +7 -26
  707. package/dist/r/src/components/ui/command/command.tsx +43 -39
  708. package/dist/r/src/components/ui/context-menu/context-menu.tsx +18 -168
  709. package/dist/r/src/components/ui/dialog/dialog-layer.tsx +266 -0
  710. package/dist/r/src/components/ui/dialog/dialog.tsx +77 -271
  711. package/dist/r/src/components/ui/drawer/drawer.tsx +5 -23
  712. package/dist/r/src/components/ui/dropdown-menu/dropdown-menu.tsx +204 -226
  713. package/dist/r/src/components/ui/dropdown-menu/menu-parts.tsx +220 -0
  714. package/dist/r/src/components/ui/field/field.tsx +1 -1
  715. package/dist/r/src/components/ui/field/number-field.tsx +1 -1
  716. package/dist/r/src/components/ui/hover-card/hover-card.tsx +4 -11
  717. package/dist/r/src/components/ui/menubar/menubar.tsx +36 -169
  718. package/dist/r/src/components/ui/message/message.tsx +0 -1
  719. package/dist/r/src/components/ui/message/parse-message-text.ts +80 -32
  720. package/dist/r/src/components/ui/modal-dialog/modal-dialog.tsx +9 -39
  721. package/dist/r/src/components/ui/navigation-menu/navigation-menu.tsx +0 -1
  722. package/dist/r/src/components/ui/popover/popover.tsx +5 -11
  723. package/dist/r/src/components/ui/resizable/resizable.tsx +6 -16
  724. package/dist/r/src/components/ui/sheet/sheet.tsx +30 -42
  725. package/dist/r/src/components/ui/text-link/index.ts +0 -1
  726. package/dist/r/src/components/ui/toggle-group/toggle-group.tsx +3 -11
  727. package/dist/r/src/components/ui/tooltip/tooltip.tsx +47 -26
  728. package/dist/r/src/components/ui/trace/index.ts +7 -0
  729. package/dist/r/src/components/ui/trace/trace.tsx +100 -9
  730. package/dist/r/src/lib/accent-presets.ts +12 -8
  731. package/dist/r/src/lib/accent-roles.ts +43 -29
  732. package/dist/r/src/lib/appearance-font-settings.ts +5 -5
  733. package/dist/r/src/lib/async-action.ts +72 -0
  734. package/dist/r/src/lib/breakpoints.ts +7 -0
  735. package/dist/r/src/lib/bytes.ts +20 -0
  736. package/dist/r/src/lib/clipboard.ts +43 -0
  737. package/dist/r/src/lib/events.ts +17 -0
  738. package/dist/r/src/lib/external-link.ts +42 -0
  739. package/dist/r/src/lib/font-catalog.ts +4 -6
  740. package/dist/r/src/lib/font-zoom.ts +9 -14
  741. package/dist/r/src/lib/overlay.ts +55 -18
  742. package/dist/r/src/lib/preference-store.ts +36 -34
  743. package/dist/r/src/lib/resize-separator.ts +36 -0
  744. package/dist/r/src/lib/safe-script.ts +19 -1
  745. package/dist/r/src/lib/scroll-geometry.ts +69 -0
  746. package/dist/r/src/lib/text.ts +49 -0
  747. package/dist/r/src/lib/theme-accents.ts +1 -1
  748. package/dist/r/src/lib/theme-catalogue.ts +3 -4
  749. package/dist/r/src/lib/theme-css.ts +33 -54
  750. package/dist/r/src/lib/theme-defaults.generated.ts +1 -1
  751. package/dist/r/src/lib/theme-defaults.ts +55 -7
  752. package/dist/r/src/lib/theme-engine-light.ts +88 -72
  753. package/dist/r/src/lib/theme-engine.ts +29 -33
  754. package/dist/r/src/lib/theme-records.ts +33 -69
  755. package/dist/r/src/lib/theme-types.ts +199 -0
  756. package/dist/r/src/lib/themes.ts +33 -196
  757. package/dist/r/src/lib/tokens.ts +0 -1
  758. package/dist/r/src/lib/url.ts +25 -0
  759. package/dist/r/src/lib/version-notes.ts +3 -9
  760. package/dist/r/src/styles/theme-variants.css +32 -32
  761. package/dist/r/src/styles/theme.css +17 -13
  762. package/dist/r/subagent.json +0 -2
  763. package/dist/r/suggestion.json +0 -1
  764. package/dist/r/theming.json +5 -20
  765. package/dist/r/top-bar.json +5 -0
  766. package/dist/r/trace.json +1 -0
  767. package/dist/r/update-dialog.json +5 -0
  768. package/package.json +9 -7
  769. package/registry.json +102 -43
  770. package/src/components/composites/about-dialog/about-dialog.tsx +22 -42
  771. package/src/components/composites/account-menu/account-menu.tsx +9 -35
  772. package/src/components/composites/action-button/action-button.tsx +5 -7
  773. package/src/components/composites/appearance-editor/accent-swatch-groups.tsx +3 -11
  774. package/src/components/composites/appearance-editor/appearance-choices.tsx +8 -5
  775. package/src/components/composites/appearance-editor/appearance-editor.tsx +8 -6
  776. package/src/components/composites/appearance-editor/appearance-rows.tsx +14 -74
  777. package/src/components/composites/appearance-editor/font-settings-group.tsx +11 -77
  778. package/src/components/composites/appearance-editor/index.ts +1 -0
  779. package/src/components/composites/catalog-browser/catalog-browser.tsx +9 -13
  780. package/src/components/composites/chain-of-thought/chain-of-thought.tsx +16 -18
  781. package/src/components/composites/chat/chat.tsx +2 -2
  782. package/src/components/composites/checkpoint/checkpoint-model.ts +3 -3
  783. package/src/components/composites/checkpoint/checkpoint.tsx +3 -3
  784. package/src/components/composites/confirmation/confirmation-model.ts +9 -17
  785. package/src/components/composites/confirmation/confirmation.tsx +2 -2
  786. package/src/components/composites/context/context-model.ts +1 -1
  787. package/src/components/composites/file-tree/build-file-tree.ts +21 -39
  788. package/src/components/composites/file-tree/file-tree.tsx +5 -58
  789. package/src/components/composites/file-tree/index.ts +1 -1
  790. package/src/components/composites/help-center/help-center.tsx +8 -21
  791. package/src/components/composites/icon-picker/icon-picker.tsx +10 -11
  792. package/src/components/composites/inline-citation/citation.ts +2 -1
  793. package/src/components/composites/inline-citation/inline-citation.tsx +3 -2
  794. package/src/components/composites/message-scroller/message-scroller.tsx +30 -30
  795. package/src/components/composites/message-scroller/scroll-anchor.ts +5 -5
  796. package/src/components/composites/model-selector/model-selector.tsx +3 -2
  797. package/src/components/composites/model-selector/models.ts +1 -1
  798. package/src/components/composites/plan/plan.tsx +1 -4
  799. package/src/components/composites/queue/queue.tsx +8 -11
  800. package/src/components/composites/reasoning/reasoning.tsx +5 -23
  801. package/src/components/composites/settings/settings-layout.tsx +3 -2
  802. package/src/components/composites/settings/settings-navigation.tsx +4 -1
  803. package/src/components/composites/sources/source.ts +7 -53
  804. package/src/components/composites/stack-trace/stack-trace.tsx +3 -12
  805. package/src/components/composites/subagent/subagent.tsx +7 -17
  806. package/src/components/composites/suggestion/suggestion.tsx +4 -3
  807. package/src/components/composites/task/task.tsx +21 -64
  808. package/src/components/composites/terminal/terminal-model.ts +4 -4
  809. package/src/components/composites/terminal/terminal.tsx +3 -12
  810. package/src/components/composites/test-results/test-results.tsx +3 -12
  811. package/src/components/composites/tool/tool.tsx +34 -40
  812. package/src/components/composites/tree/tree-navigation.ts +22 -2
  813. package/src/components/composites/tree/tree.tsx +47 -3
  814. package/src/components/composites/update-dialog/channel-control.tsx +10 -14
  815. package/src/components/composites/update-dialog/update-dialog.tsx +66 -200
  816. package/src/components/composites/update-dialog/update-model.ts +137 -0
  817. package/src/components/composites/workspace-mark/workspace-mark.tsx +1 -1
  818. package/src/components/composites/workspace-switcher/workspace-reorder-dialog.tsx +1 -18
  819. package/src/components/composites/workspace-switcher/workspace-switcher.tsx +16 -19
  820. package/src/components/conversation/busy-send-button.tsx +7 -34
  821. package/src/components/conversation/chat-composer.tsx +1 -1
  822. package/src/components/conversation/composer-core.ts +76 -0
  823. package/src/components/conversation/composer-menu.tsx +1 -1
  824. package/src/components/conversation/conversation-pane.tsx +4 -1
  825. package/src/components/conversation/conversation-surface.tsx +23 -10
  826. package/src/components/conversation/ime-guard.ts +6 -0
  827. package/src/components/conversation/internal/chat-composer-shell.tsx +24 -65
  828. package/src/components/conversation/message-composer.tsx +24 -54
  829. package/src/components/conversation/message-row.tsx +33 -47
  830. package/src/components/conversation/paste-token-editor.tsx +13 -16
  831. package/src/components/conversation/paste-tokens.ts +36 -1
  832. package/src/components/conversation/scroll-follow-core.ts +66 -137
  833. package/src/components/conversation/scroll-follow.ts +26 -67
  834. package/src/components/conversation/thread-panel.tsx +2 -4
  835. package/src/components/conversation/transcript-composition.tsx +9 -33
  836. package/src/components/conversation/transcript-folding.ts +2 -2
  837. package/src/components/conversation/transcript-grouping.ts +18 -3
  838. package/src/components/layout/contextual-sidebar/contextual-sidebar.tsx +4 -3
  839. package/src/components/layout/contextual-sidebar/mobile-contextual-sidebar.tsx +1 -1
  840. package/src/components/layout/floating-preview/model.ts +57 -195
  841. package/src/components/layout/pixel-resize-handle/pixel-resize-handle.tsx +6 -12
  842. package/src/components/layout/shell-top-bar/shell-top-bar.tsx +32 -47
  843. package/src/components/layout/side-rail/side-rail-context.ts +1 -11
  844. package/src/components/layout/side-rail/side-rail.tsx +95 -107
  845. package/src/components/layout/sidebar-nav/index.ts +1 -2
  846. package/src/components/layout/sidebar-nav/sidebar-nav-classes.ts +15 -0
  847. package/src/components/layout/sidebar-nav/sidebar-nav-resize-handle.tsx +1 -4
  848. package/src/components/layout/sidebar-nav/sidebar-nav.tsx +9 -27
  849. package/src/components/layout/split-layout/geometry.ts +2 -9
  850. package/src/components/layout/split-layout/model.ts +3 -6
  851. package/src/components/layout/split-layout/resize-controller-core-retry.tsx +12 -6
  852. package/src/components/layout/split-layout/resize-controller-core.tsx +12 -6
  853. package/src/components/layout/split-layout/split-layout.tsx +46 -61
  854. package/src/components/layout/split-layout/tree.ts +5 -0
  855. package/src/components/layout/top-bar/top-bar.tsx +16 -38
  856. package/src/components/layout/top-bar/window-chrome.ts +23 -0
  857. package/src/components/motion/presence.tsx +1 -3
  858. package/src/components/theme/appearance-panel.tsx +28 -19
  859. package/src/components/theme/index.ts +1 -22
  860. package/src/components/theme/lazy.ts +36 -26
  861. package/src/components/theme/theme-api.ts +30 -0
  862. package/src/components/theme/theme-catalogue-source.ts +3 -2
  863. package/src/components/theme/theme-document.ts +248 -23
  864. package/src/components/theme/theme-mode-toggle.tsx +1 -1
  865. package/src/components/theme/theme-persistence.ts +74 -130
  866. package/src/components/theme/theme-picker.tsx +2 -2
  867. package/src/components/theme/theme-provider-value.ts +53 -68
  868. package/src/components/theme/theme-provider.tsx +5 -24
  869. package/src/components/theme/theme-script.ts +48 -43
  870. package/src/components/theme/theme-state.ts +350 -10
  871. package/src/components/theme/theme-toggle.tsx +1 -1
  872. package/src/components/ui/alert-dialog/alert-dialog.tsx +43 -43
  873. package/src/components/ui/attachment/attachment.tsx +4 -17
  874. package/src/components/ui/avatar/avatar.tsx +3 -2
  875. package/src/components/ui/board/board.tsx +4 -10
  876. package/src/components/ui/button-group/button-group.tsx +1 -1
  877. package/src/components/ui/chart/chart.tsx +0 -3
  878. package/src/components/ui/code-block/code-block.tsx +7 -26
  879. package/src/components/ui/command/command.tsx +43 -39
  880. package/src/components/ui/context-menu/context-menu.tsx +18 -168
  881. package/src/components/ui/dialog/dialog-layer.tsx +266 -0
  882. package/src/components/ui/dialog/dialog.tsx +77 -271
  883. package/src/components/ui/drawer/drawer.tsx +5 -23
  884. package/src/components/ui/dropdown-menu/dropdown-menu.tsx +204 -226
  885. package/src/components/ui/dropdown-menu/menu-parts.tsx +220 -0
  886. package/src/components/ui/field/field.tsx +1 -1
  887. package/src/components/ui/field/number-field.tsx +1 -1
  888. package/src/components/ui/hover-card/hover-card.tsx +4 -11
  889. package/src/components/ui/menubar/menubar.tsx +36 -169
  890. package/src/components/ui/message/message.tsx +0 -1
  891. package/src/components/ui/message/parse-message-text.ts +80 -32
  892. package/src/components/ui/modal-dialog/modal-dialog.tsx +9 -39
  893. package/src/components/ui/navigation-menu/navigation-menu.tsx +0 -1
  894. package/src/components/ui/popover/popover.tsx +5 -11
  895. package/src/components/ui/resizable/resizable.tsx +6 -16
  896. package/src/components/ui/sheet/sheet.tsx +30 -42
  897. package/src/components/ui/text-link/index.ts +0 -1
  898. package/src/components/ui/toggle-group/toggle-group.tsx +3 -11
  899. package/src/components/ui/tooltip/tooltip.tsx +47 -26
  900. package/src/components/ui/trace/index.ts +7 -0
  901. package/src/components/ui/trace/trace.tsx +100 -9
  902. package/src/lib/accent-presets.ts +12 -8
  903. package/src/lib/accent-roles.ts +43 -29
  904. package/src/lib/appearance-font-settings.ts +5 -5
  905. package/src/lib/async-action.ts +72 -0
  906. package/src/lib/breakpoints.ts +7 -0
  907. package/src/lib/bytes.ts +20 -0
  908. package/src/lib/clipboard.ts +43 -0
  909. package/src/lib/events.ts +17 -0
  910. package/src/lib/external-link.ts +42 -0
  911. package/src/lib/font-catalog.ts +4 -6
  912. package/src/lib/font-zoom.ts +9 -14
  913. package/src/lib/overlay.ts +55 -18
  914. package/src/lib/preference-store.ts +36 -34
  915. package/src/lib/resize-separator.ts +36 -0
  916. package/src/lib/safe-script.ts +19 -1
  917. package/src/lib/scroll-geometry.ts +69 -0
  918. package/src/lib/text.ts +49 -0
  919. package/src/lib/theme-accents.ts +1 -1
  920. package/src/lib/theme-catalogue.ts +3 -4
  921. package/src/lib/theme-css.ts +33 -54
  922. package/src/lib/theme-defaults.generated.ts +1 -1
  923. package/src/lib/theme-defaults.ts +55 -7
  924. package/src/lib/theme-engine-light.ts +88 -72
  925. package/src/lib/theme-engine.ts +29 -33
  926. package/src/lib/theme-records.ts +33 -69
  927. package/src/lib/theme-types.ts +199 -0
  928. package/src/lib/themes.ts +33 -196
  929. package/src/lib/tokens.ts +0 -1
  930. package/src/lib/url.ts +25 -0
  931. package/src/lib/version-notes.ts +3 -9
  932. package/src/styles/theme-variants.css +32 -32
  933. package/src/styles/theme.css +17 -13
  934. package/dist/components/conversation/paste-preview.d.ts +0 -11
  935. package/dist/components/conversation/paste-preview.d.ts.map +0 -1
  936. package/dist/components/conversation/paste-preview.js +0 -27
  937. package/dist/components/conversation/paste-preview.js.map +0 -1
  938. package/dist/components/theme/theme-document-core.d.ts +0 -124
  939. package/dist/components/theme/theme-document-core.d.ts.map +0 -1
  940. package/dist/components/theme/theme-document-core.js.map +0 -1
  941. package/dist/components/theme/theme-provider-core.d.ts +0 -19
  942. package/dist/components/theme/theme-provider-core.d.ts.map +0 -1
  943. package/dist/components/theme/theme-provider-core.js +0 -27
  944. package/dist/components/theme/theme-provider-core.js.map +0 -1
  945. package/dist/components/theme/theme-provider-lazy.d.ts +0 -28
  946. package/dist/components/theme/theme-provider-lazy.d.ts.map +0 -1
  947. package/dist/components/theme/theme-provider-lazy.js +0 -35
  948. package/dist/components/theme/theme-provider-lazy.js.map +0 -1
  949. package/dist/components/theme/theme-state-core.d.ts +0 -254
  950. package/dist/components/theme/theme-state-core.d.ts.map +0 -1
  951. package/dist/components/theme/theme-state-core.js.map +0 -1
  952. package/dist/r/src/components/conversation/paste-preview.ts +0 -35
  953. package/dist/r/src/components/theme/theme-document-core.ts +0 -275
  954. package/dist/r/src/components/theme/theme-provider-core.tsx +0 -40
  955. package/dist/r/src/components/theme/theme-provider-lazy.tsx +0 -34
  956. package/dist/r/src/components/theme/theme-state-core.ts +0 -370
  957. package/src/components/conversation/paste-preview.ts +0 -35
  958. package/src/components/theme/theme-document-core.ts +0 -275
  959. package/src/components/theme/theme-provider-core.tsx +0 -40
  960. package/src/components/theme/theme-provider-lazy.tsx +0 -34
  961. package/src/components/theme/theme-state-core.ts +0 -370
@@ -1 +1 @@
1
- {"version":3,"file":"dropdown-menu.js","names":["DropdownMenu","KobalteDropdownMenu","Check","ChevronRight","Circle","Accessor","ComponentProps","createContext","Show","splitProps","useContext","menuContentPadding","destructiveMenuItem","menuItem","menuLabel","menuSwatchTone","MenuSwatchTone","menuSeparator","overlayMotion","overlaySurface","popoverArrow","topLayerProps","cn","MenuOrientation","DropdownMenuOrientationContext","HandlerEvent","Handler","args","Arguments","DropdownMenuTriggerKeyEvent","NonNullable","Trigger","DropdownMenuTriggerPointerEvent","props","local","rest","orientation","_$createComponent","Provider","value","children","_$mergeProps","modal","SCROLLABLE_OVERFLOW","OVERFLOW_PROPERTIES","const","OverflowProperty","OverflowDeclaration","Readonly","property","priority","readInlineOverflow","element","HTMLElement","map","style","getPropertyValue","getPropertyPriority","declarationsMatch","declarations","every","bypassUnboundedScrollLookup","trigger","scrollRoot","document","scrollingElement","documentElement","window","getComputedStyle","overflow","temporaryStyles","Array","original","applied","parent","parentElement","computed","overflowX","overflowY","test","setProperty","push","length","queueMicrotask","isConnected","removeProperty","DropdownMenuTrigger","inheritedOrientation","onPointerDown","event","disabled","defaultPrevented","isPrimary","button","altKey","ctrlKey","metaKey","shiftKey","currentTarget","isNativeLink","HTMLAnchorElement","hasAttribute","focus","preventScroll","pointerType","preventDefault","onKeyDown","menubarOrientation","closest","getAttribute","openingArrow","includes","key","DropdownMenuPortal","Portal","DropdownMenuContentProps","Content","hideArrow","portalMount","DropdownMenuContent","mount","class","_$memo","Arrow","DropdownMenuItem","Item","variant","shortcut","keyshortcuts","swatch","aria-keyshortcuts","when","_el$","_tmpl$","_$effect","_$className","tone","_el$2","_tmpl$2","_$insert","DropdownMenuShortcut","_el$3","_tmpl$3","_$spread","DropdownMenuCheckboxItem","CheckboxItem","_el$4","ItemIndicator","DropdownMenuRadioGroup","RadioGroup","DropdownMenuRadioItem","RadioItem","_el$5","DropdownMenuLabel","GroupLabel","DropdownMenuGroup","Group","DropdownMenuSeparator","Separator","DropdownMenuSub","Sub","DropdownMenuSubTrigger","SubTrigger","DropdownMenuSubContent","SubContent","DropdownMenu","_$createComponent","KobalteDropdownMenu","_$mergeProps","_$memo","_$className"],"sources":["../../../../src/components/ui/dropdown-menu/dropdown-menu.tsx"],"sourcesContent":["import { DropdownMenu as KobalteDropdownMenu } from '@kobalte/core/dropdown-menu'\nimport { Check, ChevronRight, Circle } from 'lucide-solid'\nimport type { Accessor, ComponentProps } from 'solid-js'\nimport { createContext, Show, splitProps, useContext } from 'solid-js'\nimport {\n menuContentPadding,\n destructiveMenuItem,\n menuItem,\n menuLabel,\n menuSwatchTone,\n type MenuSwatchTone,\n menuSeparator,\n overlayMotion,\n overlaySurface,\n popoverArrow,\n topLayerProps,\n} from '#lib/overlay'\nimport { cn } from '#lib/utils'\n\ntype MenuOrientation = 'horizontal' | 'vertical'\nconst DropdownMenuOrientationContext = createContext<Accessor<MenuOrientation | undefined>>()\ntype HandlerEvent<Handler> = Handler extends (...args: infer Arguments) => void\n ? Arguments[0]\n : never\ntype DropdownMenuTriggerKeyEvent = HandlerEvent<\n NonNullable<ComponentProps<typeof KobalteDropdownMenu.Trigger>['onKeyDown']>\n>\ntype DropdownMenuTriggerPointerEvent = HandlerEvent<\n NonNullable<ComponentProps<typeof KobalteDropdownMenu.Trigger>['onPointerDown']>\n>\n\n/**\n * DropdownMenu.\n *\n * A list of actions on a trigger, with radio groups for persistent choices\n * that fit naturally in a compact menu. Use Select for form inputs whose\n * selected value needs the field-style control, and Popover for arbitrary\n * content.\n *\n * Kobalte supplies the full menu contract — arrow keys, typeahead, the roving\n * highlight, Escape to close and return focus — which is exactly what a\n * hand-rolled `div` with click handlers gets wrong.\n * Menus are nonmodal by default so their generated focus guards do not become\n * invalid direct children of the ARIA menu. Set `modal` explicitly when the\n * surrounding interaction needs modal containment.\n *\n * The `destructive` variant marks the row with a status-coloured edge and\n * highlighted tint while keeping its label on the body foreground. Pairing it\n * with an AlertDialog is the caller's job.\n */\nexport function DropdownMenu(props: ComponentProps<typeof KobalteDropdownMenu>) {\n const [local, rest] = splitProps(props, ['modal', 'orientation'])\n const orientation = () => local.orientation\n return (\n <DropdownMenuOrientationContext.Provider value={orientation}>\n <KobalteDropdownMenu modal={local.modal ?? false} orientation={local.orientation} {...rest} />\n </DropdownMenuOrientationContext.Provider>\n )\n}\n\nconst SCROLLABLE_OVERFLOW = /(auto|scroll)/\nconst OVERFLOW_PROPERTIES = ['overflow', 'overflow-x', 'overflow-y'] as const\n\ntype OverflowProperty = (typeof OVERFLOW_PROPERTIES)[number]\ntype OverflowDeclaration = Readonly<{\n property: OverflowProperty\n value: string\n priority: string\n}>\n\nfunction readInlineOverflow(element: HTMLElement): OverflowDeclaration[] {\n return OVERFLOW_PROPERTIES.map((property) => ({\n property,\n value: element.style.getPropertyValue(property),\n priority: element.style.getPropertyPriority(property),\n }))\n}\n\nfunction declarationsMatch(element: HTMLElement, declarations: OverflowDeclaration[]) {\n return declarations.every(\n ({ property, value, priority }) =>\n element.style.getPropertyValue(property) === value &&\n element.style.getPropertyPriority(property) === priority\n )\n}\n\nfunction bypassUnboundedScrollLookup(trigger: HTMLElement) {\n const scrollRoot = document.scrollingElement ?? document.documentElement\n if (window.getComputedStyle(scrollRoot).overflow !== 'hidden') return\n\n const temporaryStyles: Array<{\n element: HTMLElement\n original: OverflowDeclaration[]\n applied: OverflowDeclaration[]\n }> = []\n\n for (let element: HTMLElement | null = trigger; element;) {\n const parent: HTMLElement | null = element.parentElement\n if (element !== scrollRoot) {\n const computed = window.getComputedStyle(element)\n const overflow = `${computed.overflow} ${computed.overflowX} ${computed.overflowY}`\n if (SCROLLABLE_OVERFLOW.test(overflow)) {\n const original = readInlineOverflow(element)\n element.style.setProperty('overflow', 'clip', 'important')\n temporaryStyles.push({ element, original, applied: readInlineOverflow(element) })\n }\n }\n element = parent\n }\n\n if (temporaryStyles.length === 0) return\n\n // Kobalte's keyboard path synchronously walks scroll parents before it opens\n // the menu. Clipping only non-root scroll ancestors makes that walk stop at\n // the locked viewport. Restore those declarations once the event handler\n // finishes, and leave any newer owner write untouched.\n queueMicrotask(() => {\n for (const { element, original, applied } of temporaryStyles) {\n if (!element.isConnected || !declarationsMatch(element, applied)) continue\n for (const property of OVERFLOW_PROPERTIES) element.style.removeProperty(property)\n for (const { property, value, priority } of original) {\n if (value) element.style.setProperty(property, value, priority)\n }\n }\n })\n}\n\nexport function DropdownMenuTrigger(props: ComponentProps<typeof KobalteDropdownMenu.Trigger>) {\n const inheritedOrientation = useContext(DropdownMenuOrientationContext)\n const [local, rest] = splitProps(props, ['disabled', 'onKeyDown', 'onPointerDown'])\n const onPointerDown = (event: DropdownMenuTriggerPointerEvent) => {\n if (typeof local.onPointerDown === 'function') local.onPointerDown(event)\n else if (local.onPointerDown) local.onPointerDown[0](local.onPointerDown[1], event)\n\n // WebKit can leave focus on a previous control when a native button gets\n // a pointer click. Focus the trigger before Kobalte opens the menu so an\n // enclosing modal focus scope does not restore focus and dismiss the menu.\n if (\n local.disabled ||\n event.defaultPrevented ||\n !event.isPrimary ||\n event.button !== 0 ||\n event.altKey ||\n event.ctrlKey ||\n event.metaKey ||\n event.shiftKey\n ) {\n return\n }\n const trigger = event.currentTarget\n const isNativeLink = trigger instanceof HTMLAnchorElement && trigger.hasAttribute('href')\n if (trigger instanceof HTMLElement && !isNativeLink) {\n trigger.focus({ preventScroll: true })\n // Focusing first is not enough in WebKit: the press's default mousedown\n // action runs afterwards and moves focus off a button to the nearest\n // focusable ancestor — inside a dialog, the dialog — so the menu that\n // just opened still reads focus leaving it and closes. Cancelling the\n // default keeps focus where it was put.\n if (event.pointerType !== 'touch') event.preventDefault()\n }\n }\n const onKeyDown = (event: DropdownMenuTriggerKeyEvent) => {\n // Kobalte's MenuTrigger does not consult defaultPrevented before its own\n // open-key handling. Preserve its existing callback behavior; this wrapper\n // only makes the pre-open scroll-parent lookup terminate.\n if (typeof local.onKeyDown === 'function') local.onKeyDown(event)\n else if (local.onKeyDown) local.onKeyDown[0](local.onKeyDown[1], event)\n\n if (local.disabled) return\n const trigger = event.currentTarget\n if (!(trigger instanceof HTMLElement)) return\n const menubarOrientation = trigger.closest('[role=\"menubar\"]')?.getAttribute('aria-orientation')\n const orientation =\n inheritedOrientation?.() ?? (menubarOrientation === 'vertical' ? 'vertical' : 'horizontal')\n const openingArrow = orientation === 'horizontal' ? 'ArrowDown' : 'ArrowRight'\n if (!['Enter', ' ', openingArrow].includes(event.key)) return\n const isNativeLink = trigger instanceof HTMLAnchorElement && trigger.hasAttribute('href')\n if (isNativeLink && (event.key === 'Enter' || event.key === ' ')) return\n bypassUnboundedScrollLookup(trigger)\n }\n\n return (\n <KobalteDropdownMenu.Trigger\n {...rest}\n disabled={local.disabled}\n onPointerDown={onPointerDown}\n onKeyDown={onKeyDown}\n />\n )\n}\n\nexport function DropdownMenuPortal(props: ComponentProps<typeof KobalteDropdownMenu.Portal>) {\n return <KobalteDropdownMenu.Portal {...props} />\n}\n\nexport type DropdownMenuContentProps = ComponentProps<typeof KobalteDropdownMenu.Content> & {\n /**\n * Kept for callers that hid the arrow explicitly; the arrow is now hidden by\n * default. Pass `false` to draw one. The default flipped because Kobalte\n * reserves half of the arrow's 30px box as popper gutter — a menu anchored to\n * its trigger floated 15px off it, which read as a gap rather than as a\n * pointer, and every anchored caller already passed `hideArrow`.\n */\n hideArrow?: boolean\n /** Mount under an owner element such as a modal, keeping the menu in its accessible subtree. */\n portalMount?: HTMLElement\n}\n\nexport function DropdownMenuContent(props: DropdownMenuContentProps) {\n const [local, rest] = splitProps(props, ['class', 'hideArrow', 'children', 'portalMount'])\n\n return (\n <KobalteDropdownMenu.Portal mount={local.portalMount}>\n <KobalteDropdownMenu.Content\n {...topLayerProps}\n class={cn(\n overlaySurface,\n overlayMotion,\n 'z-(--z-menu) min-w-[10rem] origin-(--kb-menu-content-transform-origin) overflow-hidden',\n menuContentPadding,\n local.class\n )}\n {...rest}\n >\n {local.hideArrow === false && (\n /* Rendered only when a caller asks for it back: the popper folds half\n the arrow's box into the content's gutter, so an arrow and a flush\n menu have never been true at once. */\n <KobalteDropdownMenu.Arrow aria-hidden=\"true\" class={popoverArrow} />\n )}\n {local.children}\n </KobalteDropdownMenu.Content>\n </KobalteDropdownMenu.Portal>\n )\n}\n\nexport function DropdownMenuItem(\n props: ComponentProps<typeof KobalteDropdownMenu.Item> & {\n /** Colour the row as a destructive action. Confirm it separately. */\n variant?: 'default' | 'destructive'\n /** Draw a shortcut hint at the trailing edge of the row. */\n shortcut?: string\n /**\n * The parseable chord behind `shortcut`, e.g. `Meta+E`. The drawn glyph is\n * `aria-hidden` — reading it out would pollute the item's accessible name —\n * so this is what assistive technology announces instead. Supply it\n * whenever `shortcut` is drawn.\n */\n keyshortcuts?: string\n /** Draw a leading colour dot from the shared tone ladder — the accent or\n * status role the option's card badge carries. `aria-hidden`; the label\n * carries the meaning. */\n swatch?: MenuSwatchTone\n }\n) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'variant',\n 'shortcut',\n 'keyshortcuts',\n 'swatch',\n 'children',\n ])\n\n return (\n <KobalteDropdownMenu.Item\n class={cn(\n menuItem,\n {\n [destructiveMenuItem]: local.variant === 'destructive',\n },\n local.class\n )}\n aria-keyshortcuts={local.keyshortcuts}\n {...rest}\n >\n <Show when={local.swatch}>\n <span aria-hidden=\"true\" class={menuSwatchTone({ tone: local.swatch })} />\n </Show>\n {local.children}\n {local.shortcut ? (\n <span\n aria-hidden=\"true\"\n class=\"text-muted-foreground ms-auto font-code text-code tracking-widest\"\n >\n {local.shortcut}\n </span>\n ) : null}\n </KobalteDropdownMenu.Item>\n )\n}\n\n/**\n * The chord drawn at a row's trailing edge.\n *\n * A component as well as the `shortcut` prop on an item, because a caller composing\n * a row by hand needs the same treatment — and because the alternative is every\n * caller inventing the same mono-and-dimmed span.\n *\n * The glyphs are decorative: the span is `aria-hidden` and the parseable chord\n * belongs in the row's `aria-keyshortcuts`, so the item's accessible name stays\n * exactly its label.\n */\nexport function DropdownMenuShortcut(props: ComponentProps<'span'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <span\n data-slot=\"dropdown-menu-shortcut\"\n aria-hidden=\"true\"\n class={cn('text-muted-foreground ms-auto font-code text-code tracking-widest', local.class)}\n {...rest}\n />\n )\n}\n\nexport function DropdownMenuCheckboxItem(\n props: ComponentProps<typeof KobalteDropdownMenu.CheckboxItem> & {\n /** Draw a leading colour dot from the shared tone ladder. `aria-hidden`;\n * the label carries the meaning. */\n swatch?: MenuSwatchTone\n }\n) {\n const [local, rest] = splitProps(props, ['class', 'swatch', 'children'])\n\n return (\n <KobalteDropdownMenu.CheckboxItem class={cn(menuItem, 'pe-8', local.class)} {...rest}>\n <Show when={local.swatch}>\n <span aria-hidden=\"true\" class={menuSwatchTone({ tone: local.swatch })} />\n </Show>\n {local.children}\n <KobalteDropdownMenu.ItemIndicator\n data-slot=\"dropdown-menu-indicator\"\n class=\"absolute end-2 flex size-4 items-center justify-center text-primary\"\n >\n <Check class=\"size-4\" />\n </KobalteDropdownMenu.ItemIndicator>\n </KobalteDropdownMenu.CheckboxItem>\n )\n}\n\nexport function DropdownMenuRadioGroup(\n props: ComponentProps<typeof KobalteDropdownMenu.RadioGroup>\n) {\n return <KobalteDropdownMenu.RadioGroup {...props} />\n}\n\nexport function DropdownMenuRadioItem(\n props: ComponentProps<typeof KobalteDropdownMenu.RadioItem> & {\n /** Draw a leading colour dot from the shared tone ladder. `aria-hidden`;\n * the label carries the meaning. */\n swatch?: MenuSwatchTone\n }\n) {\n const [local, rest] = splitProps(props, ['class', 'swatch', 'children'])\n\n return (\n <KobalteDropdownMenu.RadioItem class={cn(menuItem, 'pe-8', local.class)} {...rest}>\n <Show when={local.swatch}>\n <span aria-hidden=\"true\" class={menuSwatchTone({ tone: local.swatch })} />\n </Show>\n {local.children}\n {/* The indicator reads in the accent, like every other selected state in\n the system — a canvas-colored dot on a checked row reads as decoration. */}\n <KobalteDropdownMenu.ItemIndicator\n data-slot=\"dropdown-menu-indicator\"\n class=\"absolute end-2 flex size-4 items-center justify-center text-primary\"\n >\n <Circle class=\"size-2 fill-current\" />\n </KobalteDropdownMenu.ItemIndicator>\n </KobalteDropdownMenu.RadioItem>\n )\n}\n\n/**\n * The caption of a `DropdownMenuGroup`, and that group's accessible name. It must be a\n * child of the group it names: Kobalte reads the group from context, so a label\n * placed directly in the content throws `useMenuGroupContext must be used within\n * a Menu.Group` the moment the menu opens. For an ungrouped caption, wrap the\n * label and its items in a group anyway — the grouping is what a screen reader\n * announces.\n */\nexport function DropdownMenuLabel(props: ComponentProps<typeof KobalteDropdownMenu.GroupLabel>) {\n const [local, rest] = splitProps(props, ['class'])\n return <KobalteDropdownMenu.GroupLabel class={cn(menuLabel, local.class)} {...rest} />\n}\n\nexport function DropdownMenuGroup(props: ComponentProps<typeof KobalteDropdownMenu.Group>) {\n return <KobalteDropdownMenu.Group {...props} />\n}\n\nexport function DropdownMenuSeparator(props: ComponentProps<typeof KobalteDropdownMenu.Separator>) {\n const [local, rest] = splitProps(props, ['class'])\n return <KobalteDropdownMenu.Separator class={cn(menuSeparator, local.class)} {...rest} />\n}\n\nexport function DropdownMenuSub(props: ComponentProps<typeof KobalteDropdownMenu.Sub>) {\n return <KobalteDropdownMenu.Sub {...props} />\n}\n\nexport function DropdownMenuSubTrigger(\n props: ComponentProps<typeof KobalteDropdownMenu.SubTrigger>\n) {\n const [local, rest] = splitProps(props, ['class', 'children'])\n\n return (\n <KobalteDropdownMenu.SubTrigger class={cn(menuItem, local.class)} {...rest}>\n {local.children}\n <ChevronRight class=\"ms-auto size-4\" />\n </KobalteDropdownMenu.SubTrigger>\n )\n}\n\nexport function DropdownMenuSubContent(\n props: ComponentProps<typeof KobalteDropdownMenu.SubContent>\n) {\n const [local, rest] = splitProps(props, ['class'])\n\n return (\n <KobalteDropdownMenu.Portal>\n <KobalteDropdownMenu.SubContent\n {...topLayerProps}\n class={cn(\n overlaySurface,\n overlayMotion,\n 'z-(--z-menu) min-w-[8rem] origin-(--kb-menu-content-transform-origin) overflow-hidden',\n menuContentPadding,\n local.class\n )}\n {...rest}\n />\n </KobalteDropdownMenu.Portal>\n )\n}\n"],"mappings":";;;;;;;;;;AAoBA,IAAMwB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F,KAAK;CAAC,EAAA,GAAMtF,IAAI,CAAA;AACvF;AAEA,SAAgB4H,gBAAgB9H,OAAuD;CACrF,OAAAI,gBAAQpC,aAAoB+J,KAAQ/H,KAAK;AAC3C;AAEA,SAAgBgI,uBACdhI,OACA;CACA,MAAM,CAACC,OAAOC,QAAQ1B,WAAWwB,OAAO,CAAC,SAAS,UAAU,CAAC;CAE7D,OAAAI,gBACGpC,aAAoBiK,YAAUzH,WAAA,EAAA,KAAA,WAAA;EAAA,OAAQnB,GAAGT,UAAUqB,MAAMuF,KAAK;CAAC,EAAA,GAAMtF,MAAI,EAAA,IAAAK,WAAA;EAAA,OAAA,CAAAkF,WACvExF,MAAMM,QAAQ,GAAAH,gBACdlC,cAAY,EAAA,SAAA,iBAAA,CAAA,CAAA;CAAA,EAAA,CAAA,CAAA;AAGnB;AAEA,SAAgBgK,uBACdlI,OACA;CACA,MAAM,CAACC,OAAOC,QAAQ1B,WAAWwB,OAAO,CAAC,OAAO,CAAC;CAEjD,OAAAI,gBACGpC,aAAoBiH,QAAM,EAAA,IAAA1E,WAAA;EAAA,OAAAH,gBACxBpC,aAAoBmK,YAAU3H,WACzBpB,eAAa,EAAA,KAAA,WAAA;GAAA,OACVC,GACLH,gBACAD,eACA,yFAAA,OAEAgB,MAAMuF,KACR;EAAC,EAAA,GACGtF,IAAI,CAAA;CAAA,EAAA,CAAA;AAIhB"}
1
+ {"version":3,"file":"dropdown-menu.js","names":["DropdownMenu","KobalteDropdownMenu","useMenuContext","Accessor","ComponentProps","createContext","onCleanup","splitProps","useContext","callHandler","popoverArrow","topLayerProps","cn","createMenuParts","menuPanel","MenuOrientation","DropdownMenuScope","orientation","setAfterClose","callback","takeAfterClose","disposed","DropdownMenuScopeContext","HandlerEvent","Handler","args","Arguments","DropdownMenuTriggerKeyEvent","NonNullable","Trigger","DropdownMenuTriggerPointerEvent","props","local","rest","afterClose","undefined","scope","_$createComponent","Provider","value","children","_$mergeProps","modal","onOpenChange","open","SCROLLABLE_OVERFLOW","OVERFLOW_PROPERTIES","const","OverflowProperty","OverflowDeclaration","Readonly","property","priority","readInlineOverflow","element","HTMLElement","map","style","getPropertyValue","getPropertyPriority","declarationsMatch","declarations","every","bypassUnboundedScrollLookup","trigger","scrollRoot","document","scrollingElement","documentElement","window","getComputedStyle","overflow","temporaryStyles","Array","original","applied","parent","parentElement","computed","overflowX","overflowY","test","setProperty","push","length","queueMicrotask","isConnected","removeProperty","DropdownMenuTrigger","inheritedOrientation","onPointerDown","event","disabled","defaultPrevented","isPrimary","button","altKey","ctrlKey","metaKey","shiftKey","currentTarget","isNativeLink","HTMLAnchorElement","hasAttribute","focus","preventScroll","pointerType","preventDefault","onKeyDown","menubarOrientation","closest","getAttribute","openingArrow","includes","key","Portal","DropdownMenuPortal","TAB_STOP_SELECTOR","isTabStop","tabIndex","matches","getClientRects","tabStopAt","target","Element","control","adjacentTabStop","from","backwards","dialog","ownerDocument","body","stops","querySelectorAll","filter","ordered","toSorted","a","b","index","indexOf","step","at","MENU_ROW_SELECTOR","DropdownMenuContentProps","Content","hideArrow","portalMount","tabKey","DropdownMenuContent","menu","leaveTarget","onTab","KeyboardEvent","isComposing","panel","stopPropagation","rows","row","active","activeElement","next","triggerRef","close","onCloseAutoFocus","Event","isOpen","mount","class","ref","HTMLDivElement","addEventListener","removeEventListener","_$memo","Arrow","parts","DropdownMenuItem","Item","onSelectAfterClose","onSelect","DropdownMenuShortcut","Shortcut","DropdownMenuCheckboxItem","CheckboxItem","DropdownMenuRadioItem","RadioItem","DropdownMenuLabel","Label","DropdownMenuSeparator","Separator","DropdownMenuSubTrigger","SubTrigger","DropdownMenuSubContent","SubContent","Group","DropdownMenuGroup","RadioGroup","DropdownMenuRadioGroup","Sub","DropdownMenuSub","DropdownMenu","_$createComponent","KobalteDropdownMenu","_$mergeProps","_$memo"],"sources":["../../../../src/components/ui/dropdown-menu/dropdown-menu.tsx"],"sourcesContent":["import { DropdownMenu as KobalteDropdownMenu } from '@kobalte/core/dropdown-menu'\nimport { useMenuContext } from '@kobalte/core/menu'\nimport type { Accessor, ComponentProps } from 'solid-js'\nimport { createContext, onCleanup, splitProps, useContext } from 'solid-js'\nimport { callHandler } from '#lib/events'\nimport { popoverArrow, topLayerProps } from '#lib/overlay'\nimport { cn } from '#lib/utils'\nimport { createMenuParts, menuPanel } from './menu-parts'\n\ntype MenuOrientation = 'horizontal' | 'vertical'\ntype DropdownMenuScope = {\n orientation: Accessor<MenuOrientation | undefined>\n /** Queue work for after the menu has closed and focus has settled. */\n setAfterClose: (callback: (() => void) | undefined) => void\n takeAfterClose: () => (() => void) | undefined\n disposed: () => boolean\n}\nconst DropdownMenuScopeContext = createContext<DropdownMenuScope>()\ntype HandlerEvent<Handler> = Handler extends (...args: infer Arguments) => void\n ? Arguments[0]\n : never\ntype DropdownMenuTriggerKeyEvent = HandlerEvent<\n NonNullable<ComponentProps<typeof KobalteDropdownMenu.Trigger>['onKeyDown']>\n>\ntype DropdownMenuTriggerPointerEvent = HandlerEvent<\n NonNullable<ComponentProps<typeof KobalteDropdownMenu.Trigger>['onPointerDown']>\n>\n\n/**\n * DropdownMenu.\n *\n * A list of actions on a trigger, with radio groups for persistent choices\n * that fit naturally in a compact menu. Use Select for form inputs whose\n * selected value needs the field-style control, and Popover for arbitrary\n * content.\n *\n * Kobalte supplies the full menu contract — arrow keys, typeahead, the roving\n * highlight, Escape to close and return focus — which is exactly what a\n * hand-rolled `div` with click handlers gets wrong.\n * Menus are nonmodal by default so their generated focus guards do not become\n * invalid direct children of the ARIA menu. Set `modal` explicitly when the\n * surrounding interaction needs modal containment.\n *\n * The `destructive` variant marks the row with a status-coloured edge and\n * highlighted tint while keeping its label on the body foreground. Pairing it\n * with an AlertDialog is the caller's job.\n *\n * An item that opens something else — a dialog, a sheet — passes it as\n * `onSelectAfterClose`, which runs once the menu has closed and returned focus\n * to its trigger, so the next layer captures the trigger as the control to\n * return to.\n */\nexport function DropdownMenu(props: ComponentProps<typeof KobalteDropdownMenu>) {\n const [local, rest] = splitProps(props, ['modal', 'orientation', 'onOpenChange'])\n let afterClose: (() => void) | undefined\n let disposed = false\n onCleanup(() => {\n disposed = true\n afterClose = undefined\n })\n const scope: DropdownMenuScope = {\n orientation: () => local.orientation,\n setAfterClose: (callback) => (afterClose = callback),\n takeAfterClose: () => {\n const callback = afterClose\n afterClose = undefined\n return callback\n },\n disposed: () => disposed,\n }\n return (\n <DropdownMenuScopeContext.Provider value={scope}>\n <KobalteDropdownMenu\n modal={local.modal ?? false}\n orientation={local.orientation}\n onOpenChange={(open) => {\n if (open) afterClose = undefined\n local.onOpenChange?.(open)\n }}\n {...rest}\n />\n </DropdownMenuScopeContext.Provider>\n )\n}\n\nconst SCROLLABLE_OVERFLOW = /(auto|scroll)/\nconst OVERFLOW_PROPERTIES = ['overflow', 'overflow-x', 'overflow-y'] as const\n\ntype OverflowProperty = (typeof OVERFLOW_PROPERTIES)[number]\ntype OverflowDeclaration = Readonly<{\n property: OverflowProperty\n value: string\n priority: string\n}>\n\nfunction readInlineOverflow(element: HTMLElement): OverflowDeclaration[] {\n return OVERFLOW_PROPERTIES.map((property) => ({\n property,\n value: element.style.getPropertyValue(property),\n priority: element.style.getPropertyPriority(property),\n }))\n}\n\nfunction declarationsMatch(element: HTMLElement, declarations: OverflowDeclaration[]) {\n return declarations.every(\n ({ property, value, priority }) =>\n element.style.getPropertyValue(property) === value &&\n element.style.getPropertyPriority(property) === priority\n )\n}\n\nfunction bypassUnboundedScrollLookup(trigger: HTMLElement) {\n const scrollRoot = document.scrollingElement ?? document.documentElement\n if (window.getComputedStyle(scrollRoot).overflow !== 'hidden') return\n\n const temporaryStyles: Array<{\n element: HTMLElement\n original: OverflowDeclaration[]\n applied: OverflowDeclaration[]\n }> = []\n\n for (let element: HTMLElement | null = trigger; element;) {\n const parent: HTMLElement | null = element.parentElement\n if (element !== scrollRoot) {\n const computed = window.getComputedStyle(element)\n const overflow = `${computed.overflow} ${computed.overflowX} ${computed.overflowY}`\n if (SCROLLABLE_OVERFLOW.test(overflow)) {\n const original = readInlineOverflow(element)\n element.style.setProperty('overflow', 'clip', 'important')\n temporaryStyles.push({ element, original, applied: readInlineOverflow(element) })\n }\n }\n element = parent\n }\n\n if (temporaryStyles.length === 0) return\n\n // Kobalte 0.13.14's keyboard open path synchronously walks scroll parents\n // and never terminates when the root scroller is `overflow: hidden`.\n // Clipping only non-root scroll ancestors makes that walk stop at the locked\n // viewport. Restore those declarations once the event handler finishes, and\n // leave any newer owner write untouched.\n queueMicrotask(() => {\n for (const { element, original, applied } of temporaryStyles) {\n if (!element.isConnected || !declarationsMatch(element, applied)) continue\n for (const property of OVERFLOW_PROPERTIES) element.style.removeProperty(property)\n for (const { property, value, priority } of original) {\n if (value) element.style.setProperty(property, value, priority)\n }\n }\n })\n}\n\nexport function DropdownMenuTrigger(props: ComponentProps<typeof KobalteDropdownMenu.Trigger>) {\n const inheritedOrientation = useContext(DropdownMenuScopeContext)?.orientation\n const [local, rest] = splitProps(props, ['disabled', 'onKeyDown', 'onPointerDown'])\n const onPointerDown = (event: DropdownMenuTriggerPointerEvent) => {\n callHandler(local.onPointerDown, event)\n\n // WebKit can leave focus on a previous control when a native button gets\n // a pointer click. Focus the trigger before Kobalte opens the menu so an\n // enclosing modal focus scope does not restore focus and dismiss the menu.\n if (\n local.disabled ||\n event.defaultPrevented ||\n !event.isPrimary ||\n event.button !== 0 ||\n event.altKey ||\n event.ctrlKey ||\n event.metaKey ||\n event.shiftKey\n ) {\n return\n }\n const trigger = event.currentTarget\n const isNativeLink = trigger instanceof HTMLAnchorElement && trigger.hasAttribute('href')\n if (trigger instanceof HTMLElement && !isNativeLink) {\n trigger.focus({ preventScroll: true })\n // Focusing first is not enough in WebKit: the press's default mousedown\n // action runs afterwards and moves focus off a button to the nearest\n // focusable ancestor — inside a dialog, the dialog — so the menu that\n // just opened still reads focus leaving it and closes. Cancelling the\n // default keeps focus where it was put.\n if (event.pointerType !== 'touch') event.preventDefault()\n }\n }\n const onKeyDown = (event: DropdownMenuTriggerKeyEvent) => {\n // Kobalte's MenuTrigger does not consult defaultPrevented before its own\n // open-key handling. Preserve its existing callback behavior; this wrapper\n // only makes the pre-open scroll-parent lookup terminate.\n callHandler(local.onKeyDown, event)\n\n if (local.disabled) return\n const trigger = event.currentTarget\n if (!(trigger instanceof HTMLElement)) return\n const menubarOrientation = trigger.closest('[role=\"menubar\"]')?.getAttribute('aria-orientation')\n const orientation =\n inheritedOrientation?.() ?? (menubarOrientation === 'vertical' ? 'vertical' : 'horizontal')\n const openingArrow = orientation === 'horizontal' ? 'ArrowDown' : 'ArrowRight'\n if (!['Enter', ' ', openingArrow].includes(event.key)) return\n const isNativeLink = trigger instanceof HTMLAnchorElement && trigger.hasAttribute('href')\n if (isNativeLink && (event.key === 'Enter' || event.key === ' ')) return\n bypassUnboundedScrollLookup(trigger)\n }\n\n return (\n <KobalteDropdownMenu.Trigger\n {...rest}\n disabled={local.disabled}\n onPointerDown={onPointerDown}\n onKeyDown={onKeyDown}\n />\n )\n}\n\nexport { Portal as DropdownMenuPortal } from '@kobalte/core/dropdown-menu'\n\n/** The controls a pointer press can focus. */\nconst TAB_STOP_SELECTOR =\n 'a[href], area[href], button, input, select, textarea, iframe, [tabindex], [contenteditable], details > summary:first-of-type'\n\n/** Whether Tab can land on the element as the page stands now. */\nexport function isTabStop(element: HTMLElement) {\n return (\n (element.tabIndex >= 0 ||\n (element.matches('details > summary:first-of-type') && !element.hasAttribute('tabindex'))) &&\n !element.matches(':disabled') &&\n element.getAttribute('aria-disabled') !== 'true' &&\n element.closest('[hidden], [inert], [aria-hidden=\"true\"]') === null &&\n element.getClientRects().length > 0\n )\n}\n\n/** The focusable control under a pointer press, if Tab could reach it. */\nexport function tabStopAt(target: Element): HTMLElement | undefined {\n const control = target.closest<HTMLElement>(TAB_STOP_SELECTOR)\n return control && isTabStop(control) ? control : undefined\n}\n\n/**\n * The tab stop before or after `from` inside the enclosing dialog (wrapping,\n * as the dialog's focus trap does) or the document (not wrapping), skipping\n * any open menu.\n */\nfunction adjacentTabStop(from: HTMLElement, backwards: boolean): HTMLElement | undefined {\n const dialog = from.closest<HTMLElement>('[role=\"dialog\"]')\n const scope = dialog ?? from.ownerDocument.body\n // Every element, not just TAB_STOP_SELECTOR: the native tabIndex decides,\n // which keeps details summaries and explicit tabindex overrides in order.\n const stops = Array.from(scope.querySelectorAll<HTMLElement>('*')).filter(\n (element) => isTabStop(element) && element.closest('[role=\"menu\"]') === null\n )\n const ordered = [\n ...stops.filter((element) => element.tabIndex > 0).toSorted((a, b) => a.tabIndex - b.tabIndex),\n ...stops.filter((element) => element.tabIndex <= 0),\n ]\n const index = ordered.indexOf(from)\n if (index < 0) return undefined\n const step = backwards ? -1 : 1\n return ordered[index + step] ?? (dialog ? (backwards ? ordered.at(-1) : ordered[0]) : undefined)\n}\n\nconst MENU_ROW_SELECTOR = '[role=\"menuitem\"], [role=\"menuitemradio\"], [role=\"menuitemcheckbox\"]'\n\nexport type DropdownMenuContentProps = ComponentProps<typeof KobalteDropdownMenu.Content> & {\n /**\n * Kept for callers that hid the arrow explicitly; the arrow is now hidden by\n * default. Pass `false` to draw one. The default flipped because Kobalte\n * reserves half of the arrow's 30px box as popper gutter — a menu anchored to\n * its trigger floated 15px off it, which read as a gap rather than as a\n * pointer, and every anchored caller already passed `hideArrow`.\n */\n hideArrow?: boolean\n /** Mount under an owner element such as a modal, keeping the menu in its accessible subtree. */\n portalMount?: HTMLElement\n /**\n * What Tab does while the menu is open. Kobalte 0.13.14 swallows it and\n * leaves focus where it was; `leave` closes the menu and moves on to the tab\n * stop after (or, with Shift, before) the trigger, inside an enclosing\n * dialog or the page; `cycle` moves between the menu's enabled rows.\n */\n tabKey?: 'leave' | 'cycle'\n}\n\nexport function DropdownMenuContent(props: DropdownMenuContentProps) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'hideArrow',\n 'children',\n 'portalMount',\n 'tabKey',\n 'ref',\n 'onCloseAutoFocus',\n ])\n const scope = useContext(DropdownMenuScopeContext)\n const menu = useMenuContext()\n let leaveTarget: HTMLElement | undefined\n\n // A capture listener on the panel, because Kobalte's list handler moves focus\n // on Tab itself and runs whatever a caller's `onKeyDown` does.\n const onTab = (event: KeyboardEvent) => {\n if (event.key !== 'Tab' || event.isComposing || !local.tabKey) return\n const panel = event.currentTarget as HTMLElement\n event.preventDefault()\n event.stopPropagation()\n if (local.tabKey === 'cycle') {\n const rows = Array.from(panel.querySelectorAll<HTMLElement>(MENU_ROW_SELECTOR)).filter(\n (row) => row.getAttribute('aria-disabled') !== 'true'\n )\n if (!rows.length) return\n const active = document.activeElement\n const index = active instanceof HTMLElement ? rows.indexOf(active) : -1\n const step = event.shiftKey ? -1 : 1\n const next =\n index < 0\n ? event.shiftKey\n ? rows.length - 1\n : 0\n : (index + step + rows.length) % rows.length\n rows[next]?.focus()\n return\n }\n const trigger = menu.triggerRef()\n leaveTarget = trigger ? adjacentTabStop(trigger, event.shiftKey) : undefined\n // Focus first, so a nonmodal menu sees the focus leave and skips its own\n // return-to-trigger; then close in case it did not dismiss itself.\n leaveTarget?.focus({ preventScroll: true })\n menu.close(true)\n }\n\n const onCloseAutoFocus = (event: Event) => {\n local.onCloseAutoFocus?.(event)\n const target = leaveTarget\n leaveTarget = undefined\n if (target) {\n event.preventDefault()\n // Kobalte's focus scope restores its stale mount-time focus after this\n // callback; land on the Tab destination once that has run.\n queueMicrotask(() => {\n if (!menu.isOpen() && target.isConnected && document.activeElement !== target) {\n target.focus({ preventScroll: true })\n }\n })\n }\n const afterClose = scope?.takeAfterClose()\n // Kobalte returns focus to the trigger and releases its focus scope after\n // this callback; the queued work runs once that has finished.\n if (afterClose) queueMicrotask(() => scope?.disposed() || afterClose())\n }\n\n return (\n <KobalteDropdownMenu.Portal mount={local.portalMount}>\n <KobalteDropdownMenu.Content\n {...topLayerProps}\n class={cn(menuPanel, 'min-w-[10rem]', local.class)}\n {...rest}\n ref={(element: HTMLDivElement) => {\n element.addEventListener('keydown', onTab, true)\n onCleanup(() => element.removeEventListener('keydown', onTab, true))\n if (typeof local.ref === 'function') local.ref(element)\n }}\n onCloseAutoFocus={onCloseAutoFocus}\n >\n {local.hideArrow === false && (\n /* Rendered only when a caller asks for it back: the popper folds half\n the arrow's box into the content's gutter, so an arrow and a flush\n menu have never been true at once. */\n <KobalteDropdownMenu.Arrow aria-hidden=\"true\" class={popoverArrow} />\n )}\n {local.children}\n </KobalteDropdownMenu.Content>\n </KobalteDropdownMenu.Portal>\n )\n}\n\nconst parts = createMenuParts(KobalteDropdownMenu, 'dropdown-menu')\n\nexport function DropdownMenuItem(\n props: ComponentProps<typeof parts.Item> & {\n /**\n * Runs after the menu has closed and returned focus to its trigger — the\n * place to open a dialog or sheet, which then returns focus to the trigger.\n */\n onSelectAfterClose?: () => void\n }\n) {\n const scope = useContext(DropdownMenuScopeContext)\n const [local, rest] = splitProps(props, ['onSelectAfterClose', 'onSelect'])\n return (\n <parts.Item\n {...rest}\n onSelect={() => {\n scope?.setAfterClose(local.onSelectAfterClose)\n local.onSelect?.()\n }}\n />\n )\n}\n\nexport const DropdownMenuShortcut = parts.Shortcut\nexport const DropdownMenuCheckboxItem = parts.CheckboxItem\nexport const DropdownMenuRadioItem = parts.RadioItem\nexport const DropdownMenuLabel = parts.Label\nexport const DropdownMenuSeparator = parts.Separator\nexport const DropdownMenuSubTrigger = parts.SubTrigger\nexport const DropdownMenuSubContent = parts.SubContent\nexport {\n Group as DropdownMenuGroup,\n RadioGroup as DropdownMenuRadioGroup,\n Sub as DropdownMenuSub,\n} from '@kobalte/core/dropdown-menu'\n"],"mappings":";;;;;;;;;AAiBA,IAAMsB,2BAA2BjB,cAAiC;;;;;;;;;;;;;;;;;;;;;;;;;AAmClE,SAAgBL,eAAa+B,OAAmD;CAC9E,MAAM,CAACC,OAAOC,QAAQ1B,WAAWwB,OAAO;EAAC;EAAS;EAAe;CAAc,CAAC;CAChF,IAAIG;CACJ,IAAIb,WAAW;CACff,gBAAgB;EACde,WAAW;EACXa,aAAaC,KAAAA;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AK;GAAC,EAAA,GAC9CvI,MAAI;IAAAwI,MACFnH,YAA4B;KAChCA,QAAQqH,iBAAiB,WAAWnB,OAAO,IAAI;KAC/ClJ,gBAAgBgD,QAAQsH,oBAAoB,WAAWpB,OAAO,IAAI,CAAC;KACnE,IAAI,OAAOxH,MAAMyI,QAAQ,YAAYzI,MAAMyI,IAAInH,OAAO;IACxD;IACkB8G;IAAgB,IAAA5H,WAAA;KAAA,OAAA,CAAAqI,WAEjCA,WAAA7I,MAAMkH,cAAc,KAAK,CAAA,CAAA,KACxB7G,gBAGCpC,aAAoB6K,OAAK;MAAA,eAAA;MAAA,SAAA;KAAuC,CAAA,CAClE,GAAAD,WACA7I,MAAMQ,QAAQ,CAAA;IAAA;GAAA,CAAA,CAAA;EAAA;CAAA,CAAA;AAIvB;AAEA,IAAMuI,QAAQlK,gBAAgBZ,cAAqB,eAAe;AAElE,SAAgB+K,iBACdjJ,OAOA;CACA,MAAMK,QAAQ5B,WAAWc,wBAAwB;CACjD,MAAM,CAACU,OAAOC,QAAQ1B,WAAWwB,OAAO,CAAC,sBAAsB,UAAU,CAAC;CAC1E,OAAAM,gBACG0I,MAAME,MAAIxI,WACLR,MAAI,EACRkJ,gBAAgB;EACd/I,OAAOlB,cAAcc,MAAMkJ,kBAAkB;EAC7ClJ,MAAMmJ,WAAW;CACnB,EAAC,CAAA,CAAA;AAGP;AAEA,IAAaC,uBAAuBL,MAAMM;AAC1C,IAAaC,2BAA2BP,MAAMQ;AAC9C,IAAaC,wBAAwBT,MAAMU;AAC3C,IAAaC,oBAAoBX,MAAMY;AACvC,IAAaC,wBAAwBb,MAAMc;AAC3C,IAAaC,yBAAyBf,MAAMgB;AAC5C,IAAaC,yBAAyBjB,MAAMkB"}
@@ -0,0 +1,46 @@
1
+ import type { DropdownMenu as KobalteDropdownMenu } from '@kobalte/core/dropdown-menu';
2
+ import type { ComponentProps } from 'solid-js';
3
+ import { type MenuSwatchTone } from '#lib/overlay';
4
+ /**
5
+ * The rows and panels every Kobalte menu family draws alike — DropdownMenu,
6
+ * ContextMenu and Menubar. Kobalte builds all three from the same menu
7
+ * primitives; each family passes its own namespace and keeps its own exported
8
+ * names, so a row looks and reads the same whichever menu it is in.
9
+ */
10
+ type MenuPrimitives = Pick<typeof KobalteDropdownMenu, 'Item' | 'CheckboxItem' | 'RadioItem' | 'ItemIndicator' | 'GroupLabel' | 'Separator' | 'SubTrigger' | 'SubContent' | 'Portal'>;
11
+ /** The floating panel of a menu or submenu; `min-w-*` is the caller's. */
12
+ export declare const menuPanel: string;
13
+ export type MenuItemProps<Item> = Item & {
14
+ /** Colour the row as a destructive action. Confirm it separately. */
15
+ variant?: 'default' | 'destructive';
16
+ /** Draw a shortcut hint at the trailing edge of the row. */
17
+ shortcut?: string;
18
+ /**
19
+ * The parseable chord behind `shortcut`, e.g. `Meta+E`. The drawn glyph is
20
+ * `aria-hidden` — reading it out would pollute the item's accessible name —
21
+ * so this is what assistive technology announces instead. Supply it
22
+ * whenever `shortcut` is drawn.
23
+ */
24
+ keyshortcuts?: string;
25
+ /** Draw a leading colour dot from the shared tone ladder — the accent or
26
+ * status role the option's card badge carries. `aria-hidden`; the label
27
+ * carries the meaning. */
28
+ swatch?: MenuSwatchTone;
29
+ };
30
+ export type MenuChoiceItemProps<Item> = Item & {
31
+ /** Draw a leading colour dot from the shared tone ladder. `aria-hidden`;
32
+ * the label carries the meaning. */
33
+ swatch?: MenuSwatchTone;
34
+ };
35
+ export declare function createMenuParts(Menu: MenuPrimitives, family: 'dropdown-menu' | 'context-menu' | 'menubar'): {
36
+ Item: (props: MenuItemProps<ComponentProps<typeof KobalteDropdownMenu.Item>>) => import("solid-js").JSX.Element;
37
+ Shortcut: (props: ComponentProps<'span'>) => import("solid-js").JSX.Element;
38
+ CheckboxItem: (props: MenuChoiceItemProps<ComponentProps<typeof KobalteDropdownMenu.CheckboxItem>>) => import("solid-js").JSX.Element;
39
+ RadioItem: (props: MenuChoiceItemProps<ComponentProps<typeof KobalteDropdownMenu.RadioItem>>) => import("solid-js").JSX.Element;
40
+ Label: (props: ComponentProps<typeof KobalteDropdownMenu.GroupLabel>) => import("solid-js").JSX.Element;
41
+ Separator: (props: ComponentProps<typeof KobalteDropdownMenu.Separator>) => import("solid-js").JSX.Element;
42
+ SubTrigger: (props: ComponentProps<typeof KobalteDropdownMenu.SubTrigger>) => import("solid-js").JSX.Element;
43
+ SubContent: (props: ComponentProps<typeof KobalteDropdownMenu.SubContent>) => import("solid-js").JSX.Element;
44
+ };
45
+ export {};
46
+ //# sourceMappingURL=menu-parts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"menu-parts.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/dropdown-menu/menu-parts.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,IAAI,mBAAmB,EAAE,MAAM,6BAA6B,CAAA;AAEtF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAE9C,OAAO,EAWL,KAAK,cAAc,EACpB,MAAM,cAAc,CAAA;AAGrB;;;;;GAKG;AACH,KAAK,cAAc,GAAG,IAAI,CACxB,OAAO,mBAAmB,EACxB,MAAM,GACN,cAAc,GACd,WAAW,GACX,eAAe,GACf,YAAY,GACZ,WAAW,GACX,YAAY,GACZ,YAAY,GACZ,QAAQ,CACX,CAAA;AAED,0EAA0E;AAC1E,eAAO,MAAM,SAAS,QAKrB,CAAA;AAED,MAAM,MAAM,aAAa,CAAC,IAAI,IAAI,IAAI,GAAG;IACvC,qEAAqE;IACrE,OAAO,CAAC,EAAE,SAAS,GAAG,aAAa,CAAA;IACnC,4DAA4D;IAC5D,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB;;;;;OAKG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB;;8BAE0B;IAC1B,MAAM,CAAC,EAAE,cAAc,CAAA;CACxB,CAAA;AAED,MAAM,MAAM,mBAAmB,CAAC,IAAI,IAAI,IAAI,GAAG;IAC7C;wCACoC;IACpC,MAAM,CAAC,EAAE,cAAc,CAAA;CACxB,CAAA;AAUD,wBAAgB,eAAe,CAC7B,IAAI,EAAE,cAAc,EACpB,MAAM,EAAE,eAAe,GAAG,cAAc,GAAG,SAAS;kBAI/B,aAAa,CAAC,cAAc,CAAC,OAAO,mBAAmB,CAAC,IAAI,CAAC,CAAC;sBAqC1D,cAAc,CAAC,MAAM,CAAC;0BAetC,mBAAmB,CAAC,cAAc,CAAC,OAAO,mBAAmB,CAAC,YAAY,CAAC,CAAC;uBAmB5E,mBAAmB,CAAC,cAAc,CAAC,OAAO,mBAAmB,CAAC,SAAS,CAAC,CAAC;mBA0B5D,cAAc,CAAC,OAAO,mBAAmB,CAAC,UAAU,CAAC;uBAMjD,cAAc,CAAC,OAAO,mBAAmB,CAAC,SAAS,CAAC;wBAMnD,cAAc,CAAC,OAAO,mBAAmB,CAAC,UAAU,CAAC;wBAWrD,cAAc,CAAC,OAAO,mBAAmB,CAAC,UAAU,CAAC;EAejF"}
@@ -0,0 +1,176 @@
1
+ import { destructiveMenuItem, menuItem, menuLabel, menuSeparator, menuShortcut, menuSwatchTone, overlayMotion, overlaySurface, topLayerProps } from "../../../lib/overlay.js";
2
+ import { cn } from "../../../lib/utils.js";
3
+ import { className, createComponent, effect, insert, memo, mergeProps, setAttribute, spread, template } from "solid-js/web";
4
+ import { Check, ChevronRight, Circle } from "lucide-solid";
5
+ import { Show, splitProps } from "solid-js";
6
+ // src/components/ui/dropdown-menu/menu-parts.tsx
7
+ var _tmpl$ = /*#__PURE__*/ template(`<span aria-hidden=true>`);
8
+ /** The floating panel of a menu or submenu; `min-w-*` is the caller's. */
9
+ var menuPanel = cn(overlaySurface, overlayMotion, "z-(--z-menu) origin-(--kb-menu-content-transform-origin) overflow-hidden", "p-1");
10
+ function Swatch(props) {
11
+ return createComponent(Show, {
12
+ get when() {
13
+ return props.tone;
14
+ },
15
+ get children() {
16
+ var _el$ = _tmpl$();
17
+ effect(() => className(_el$, menuSwatchTone({ tone: props.tone })));
18
+ return _el$;
19
+ }
20
+ });
21
+ }
22
+ function createMenuParts(Menu, family) {
23
+ const indicatorSlot = `${family}-indicator`;
24
+ function Item(props) {
25
+ const ItemPrimitive = Menu.Item;
26
+ const [local, rest] = splitProps(props, [
27
+ "class",
28
+ "variant",
29
+ "shortcut",
30
+ "keyshortcuts",
31
+ "swatch",
32
+ "children"
33
+ ]);
34
+ return createComponent(ItemPrimitive, mergeProps({
35
+ get ["class"]() {
36
+ return cn(menuItem, { [destructiveMenuItem]: local.variant === "destructive" }, local.class);
37
+ },
38
+ get ["aria-keyshortcuts"]() {
39
+ return local.keyshortcuts;
40
+ }
41
+ }, rest, { get children() {
42
+ return [
43
+ createComponent(Swatch, { get tone() {
44
+ return local.swatch;
45
+ } }),
46
+ memo(() => local.children),
47
+ memo(() => memo(() => !!local.shortcut)() ? (() => {
48
+ var _el$2 = _tmpl$();
49
+ className(_el$2, menuShortcut);
50
+ insert(_el$2, () => local.shortcut);
51
+ return _el$2;
52
+ })() : null)
53
+ ];
54
+ } }));
55
+ }
56
+ /**
57
+ * The chord drawn at a row's trailing edge, for a caller composing a row by
58
+ * hand. The glyphs are decorative: the span is `aria-hidden` and the
59
+ * parseable chord belongs in the row's `aria-keyshortcuts`, so the item's
60
+ * accessible name stays exactly its label.
61
+ */
62
+ function Shortcut(props) {
63
+ const [local, rest] = splitProps(props, ["class"]);
64
+ return (() => {
65
+ var _el$3 = _tmpl$();
66
+ setAttribute(_el$3, "data-slot", `${family}-shortcut`);
67
+ spread(_el$3, mergeProps({ get ["class"]() {
68
+ return cn(menuShortcut, local.class);
69
+ } }, rest), false, false);
70
+ return _el$3;
71
+ })();
72
+ }
73
+ function CheckboxItem(props) {
74
+ const { CheckboxItem: CheckboxItemPrimitive, ItemIndicator } = Menu;
75
+ const [local, rest] = splitProps(props, [
76
+ "class",
77
+ "swatch",
78
+ "children"
79
+ ]);
80
+ return createComponent(CheckboxItemPrimitive, mergeProps({ get ["class"]() {
81
+ return cn(menuItem, "pe-8", local.class);
82
+ } }, rest, { get children() {
83
+ return [
84
+ createComponent(Swatch, { get tone() {
85
+ return local.swatch;
86
+ } }),
87
+ memo(() => local.children),
88
+ createComponent(ItemIndicator, {
89
+ "data-slot": indicatorSlot,
90
+ "class": "absolute end-2 flex size-4 items-center justify-center text-primary",
91
+ get children() {
92
+ return createComponent(Check, { "class": "size-4" });
93
+ }
94
+ })
95
+ ];
96
+ } }));
97
+ }
98
+ function RadioItem(props) {
99
+ const { RadioItem: RadioItemPrimitive, ItemIndicator } = Menu;
100
+ const [local, rest] = splitProps(props, [
101
+ "class",
102
+ "swatch",
103
+ "children"
104
+ ]);
105
+ return createComponent(RadioItemPrimitive, mergeProps({ get ["class"]() {
106
+ return cn(menuItem, "pe-8", local.class);
107
+ } }, rest, { get children() {
108
+ return [
109
+ createComponent(Swatch, { get tone() {
110
+ return local.swatch;
111
+ } }),
112
+ memo(() => local.children),
113
+ createComponent(ItemIndicator, {
114
+ "data-slot": indicatorSlot,
115
+ "class": "absolute end-2 flex size-4 items-center justify-center text-primary",
116
+ get children() {
117
+ return createComponent(Circle, { "class": "size-2 fill-current" });
118
+ }
119
+ })
120
+ ];
121
+ } }));
122
+ }
123
+ /**
124
+ * The caption of a group, and that group's accessible name. It must be a
125
+ * child of the group it names: Kobalte reads the group from context, so a
126
+ * label placed directly in the content throws `useMenuGroupContext must be
127
+ * used within a Menu.Group` the moment the menu opens. For an ungrouped
128
+ * caption, wrap the label and its items in a group anyway — the grouping is
129
+ * what a screen reader announces.
130
+ */
131
+ function Label(props) {
132
+ const GroupLabel = Menu.GroupLabel;
133
+ const [local, rest] = splitProps(props, ["class"]);
134
+ return createComponent(GroupLabel, mergeProps({ get ["class"]() {
135
+ return cn(menuLabel, local.class);
136
+ } }, rest));
137
+ }
138
+ function Separator(props) {
139
+ const SeparatorPrimitive = Menu.Separator;
140
+ const [local, rest] = splitProps(props, ["class"]);
141
+ return createComponent(SeparatorPrimitive, mergeProps({ get ["class"]() {
142
+ return cn(menuSeparator, local.class);
143
+ } }, rest));
144
+ }
145
+ function SubTrigger(props) {
146
+ const SubTriggerPrimitive = Menu.SubTrigger;
147
+ const [local, rest] = splitProps(props, ["class", "children"]);
148
+ return createComponent(SubTriggerPrimitive, mergeProps({ get ["class"]() {
149
+ return cn(menuItem, local.class);
150
+ } }, rest, { get children() {
151
+ return [memo(() => local.children), createComponent(ChevronRight, { "class": "ms-auto size-4" })];
152
+ } }));
153
+ }
154
+ function SubContent(props) {
155
+ const { SubContent: SubContentPrimitive, Portal } = Menu;
156
+ const [local, rest] = splitProps(props, ["class"]);
157
+ return createComponent(Portal, { get children() {
158
+ return createComponent(SubContentPrimitive, mergeProps(topLayerProps, { get ["class"]() {
159
+ return cn(menuPanel, "min-w-[8rem]", local.class);
160
+ } }, rest));
161
+ } });
162
+ }
163
+ return {
164
+ Item,
165
+ Shortcut,
166
+ CheckboxItem,
167
+ RadioItem,
168
+ Label,
169
+ Separator,
170
+ SubTrigger,
171
+ SubContent
172
+ };
173
+ }
174
+ export { createMenuParts, menuPanel };
175
+
176
+ //# sourceMappingURL=menu-parts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"menu-parts.js","names":["DropdownMenu","KobalteDropdownMenu","Check","ChevronRight","Circle","ComponentProps","Show","splitProps","destructiveMenuItem","menuContentPadding","menuItem","menuLabel","menuSeparator","menuShortcut","menuSwatchTone","overlayMotion","overlaySurface","topLayerProps","MenuSwatchTone","cn","MenuPrimitives","Pick","menuPanel","MenuItemProps","Item","variant","shortcut","keyshortcuts","swatch","MenuChoiceItemProps","Swatch","props","tone","_$createComponent","when","children","_el$","_tmpl$","_$effect","_$className","createMenuParts","Menu","family","indicatorSlot","ItemPrimitive","local","rest","_$mergeProps","class","aria-keyshortcuts","_$memo","_el$2","_$insert","Shortcut","_el$3","_$setAttribute","_$spread","CheckboxItem","CheckboxItemPrimitive","ItemIndicator","RadioItem","RadioItemPrimitive","Label","GroupLabel","Separator","SeparatorPrimitive","SubTrigger","SubTriggerPrimitive","SubContent","SubContentPrimitive","Portal","_$createComponent","_$className","_$mergeProps","_$memo"],"sources":["../../../../src/components/ui/dropdown-menu/menu-parts.tsx"],"sourcesContent":["import type { DropdownMenu as KobalteDropdownMenu } from '@kobalte/core/dropdown-menu'\nimport { Check, ChevronRight, Circle } from 'lucide-solid'\nimport type { ComponentProps } from 'solid-js'\nimport { Show, splitProps } from 'solid-js'\nimport {\n destructiveMenuItem,\n menuContentPadding,\n menuItem,\n menuLabel,\n menuSeparator,\n menuShortcut,\n menuSwatchTone,\n overlayMotion,\n overlaySurface,\n topLayerProps,\n type MenuSwatchTone,\n} from '#lib/overlay'\nimport { cn } from '#lib/utils'\n\n/**\n * The rows and panels every Kobalte menu family draws alike — DropdownMenu,\n * ContextMenu and Menubar. Kobalte builds all three from the same menu\n * primitives; each family passes its own namespace and keeps its own exported\n * names, so a row looks and reads the same whichever menu it is in.\n */\ntype MenuPrimitives = Pick<\n typeof KobalteDropdownMenu,\n | 'Item'\n | 'CheckboxItem'\n | 'RadioItem'\n | 'ItemIndicator'\n | 'GroupLabel'\n | 'Separator'\n | 'SubTrigger'\n | 'SubContent'\n | 'Portal'\n>\n\n/** The floating panel of a menu or submenu; `min-w-*` is the caller's. */\nexport const menuPanel = cn(\n overlaySurface,\n overlayMotion,\n 'z-(--z-menu) origin-(--kb-menu-content-transform-origin) overflow-hidden',\n menuContentPadding\n)\n\nexport type MenuItemProps<Item> = Item & {\n /** Colour the row as a destructive action. Confirm it separately. */\n variant?: 'default' | 'destructive'\n /** Draw a shortcut hint at the trailing edge of the row. */\n shortcut?: string\n /**\n * The parseable chord behind `shortcut`, e.g. `Meta+E`. The drawn glyph is\n * `aria-hidden` — reading it out would pollute the item's accessible name —\n * so this is what assistive technology announces instead. Supply it\n * whenever `shortcut` is drawn.\n */\n keyshortcuts?: string\n /** Draw a leading colour dot from the shared tone ladder — the accent or\n * status role the option's card badge carries. `aria-hidden`; the label\n * carries the meaning. */\n swatch?: MenuSwatchTone\n}\n\nexport type MenuChoiceItemProps<Item> = Item & {\n /** Draw a leading colour dot from the shared tone ladder. `aria-hidden`;\n * the label carries the meaning. */\n swatch?: MenuSwatchTone\n}\n\nfunction Swatch(props: { tone: MenuSwatchTone | undefined }) {\n return (\n <Show when={props.tone}>\n <span aria-hidden=\"true\" class={menuSwatchTone({ tone: props.tone })} />\n </Show>\n )\n}\n\nexport function createMenuParts(\n Menu: MenuPrimitives,\n family: 'dropdown-menu' | 'context-menu' | 'menubar'\n) {\n const indicatorSlot = `${family}-indicator`\n\n function Item(props: MenuItemProps<ComponentProps<typeof KobalteDropdownMenu.Item>>) {\n const ItemPrimitive = Menu.Item\n const [local, rest] = splitProps(props, [\n 'class',\n 'variant',\n 'shortcut',\n 'keyshortcuts',\n 'swatch',\n 'children',\n ])\n return (\n <ItemPrimitive\n class={cn(\n menuItem,\n { [destructiveMenuItem]: local.variant === 'destructive' },\n local.class\n )}\n aria-keyshortcuts={local.keyshortcuts}\n {...rest}\n >\n <Swatch tone={local.swatch} />\n {local.children}\n {local.shortcut ? (\n <span aria-hidden=\"true\" class={menuShortcut}>\n {local.shortcut}\n </span>\n ) : null}\n </ItemPrimitive>\n )\n }\n\n /**\n * The chord drawn at a row's trailing edge, for a caller composing a row by\n * hand. The glyphs are decorative: the span is `aria-hidden` and the\n * parseable chord belongs in the row's `aria-keyshortcuts`, so the item's\n * accessible name stays exactly its label.\n */\n function Shortcut(props: ComponentProps<'span'>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <span\n data-slot={`${family}-shortcut`}\n aria-hidden=\"true\"\n class={cn(menuShortcut, local.class)}\n {...rest}\n />\n )\n }\n\n // Selection indicators read in the accent, like every other selected state\n // in the system — a canvas-coloured mark on a checked row reads as decoration.\n function CheckboxItem(\n props: MenuChoiceItemProps<ComponentProps<typeof KobalteDropdownMenu.CheckboxItem>>\n ) {\n const { CheckboxItem: CheckboxItemPrimitive, ItemIndicator } = Menu\n const [local, rest] = splitProps(props, ['class', 'swatch', 'children'])\n return (\n <CheckboxItemPrimitive class={cn(menuItem, 'pe-8', local.class)} {...rest}>\n <Swatch tone={local.swatch} />\n {local.children}\n <ItemIndicator\n data-slot={indicatorSlot}\n class=\"absolute end-2 flex size-4 items-center justify-center text-primary\"\n >\n <Check class=\"size-4\" />\n </ItemIndicator>\n </CheckboxItemPrimitive>\n )\n }\n\n function RadioItem(\n props: MenuChoiceItemProps<ComponentProps<typeof KobalteDropdownMenu.RadioItem>>\n ) {\n const { RadioItem: RadioItemPrimitive, ItemIndicator } = Menu\n const [local, rest] = splitProps(props, ['class', 'swatch', 'children'])\n return (\n <RadioItemPrimitive class={cn(menuItem, 'pe-8', local.class)} {...rest}>\n <Swatch tone={local.swatch} />\n {local.children}\n <ItemIndicator\n data-slot={indicatorSlot}\n class=\"absolute end-2 flex size-4 items-center justify-center text-primary\"\n >\n <Circle class=\"size-2 fill-current\" />\n </ItemIndicator>\n </RadioItemPrimitive>\n )\n }\n\n /**\n * The caption of a group, and that group's accessible name. It must be a\n * child of the group it names: Kobalte reads the group from context, so a\n * label placed directly in the content throws `useMenuGroupContext must be\n * used within a Menu.Group` the moment the menu opens. For an ungrouped\n * caption, wrap the label and its items in a group anyway — the grouping is\n * what a screen reader announces.\n */\n function Label(props: ComponentProps<typeof KobalteDropdownMenu.GroupLabel>) {\n const GroupLabel = Menu.GroupLabel\n const [local, rest] = splitProps(props, ['class'])\n return <GroupLabel class={cn(menuLabel, local.class)} {...rest} />\n }\n\n function Separator(props: ComponentProps<typeof KobalteDropdownMenu.Separator>) {\n const SeparatorPrimitive = Menu.Separator\n const [local, rest] = splitProps(props, ['class'])\n return <SeparatorPrimitive class={cn(menuSeparator, local.class)} {...rest} />\n }\n\n function SubTrigger(props: ComponentProps<typeof KobalteDropdownMenu.SubTrigger>) {\n const SubTriggerPrimitive = Menu.SubTrigger\n const [local, rest] = splitProps(props, ['class', 'children'])\n return (\n <SubTriggerPrimitive class={cn(menuItem, local.class)} {...rest}>\n {local.children}\n <ChevronRight class=\"ms-auto size-4\" />\n </SubTriggerPrimitive>\n )\n }\n\n function SubContent(props: ComponentProps<typeof KobalteDropdownMenu.SubContent>) {\n const { SubContent: SubContentPrimitive, Portal } = Menu\n const [local, rest] = splitProps(props, ['class'])\n return (\n <Portal>\n <SubContentPrimitive\n {...topLayerProps}\n class={cn(menuPanel, 'min-w-[8rem]', local.class)}\n {...rest}\n />\n </Portal>\n )\n }\n\n return { Item, Shortcut, CheckboxItem, RadioItem, Label, Separator, SubTrigger, SubContent }\n}\n"],"mappings":";;;;;;;;AAuCA,IAAasB,YAAYH,GACvBH,gBACAD,eACA,4EAAA,KAEF;AA0BA,SAASe,OAAOC,OAA6C;CAC3D,OAAAE,gBACG3B,MAAI;EAAA,IAAC4B,OAAI;GAAA,OAAEH,MAAMC;EAAI;EAAA,IAAAG,WAAA;GAAA,IAAAC,OAAAC,OAAA;GAAAC,aAAAC,UAAAH,MACYtB,eAAe,EAAEkB,MAAMD,MAAMC,KAAK,CAAC,CAAC,CAAA;GAAA,OAAAI;EAAA;CAAA,CAAA;AAG1E;AAEA,SAAgBI,gBACdC,MACAC,QACA;CACA,MAAMC,gBAAgB,GAAGD,OAAM;CAE/B,SAASlB,KAAKO,OAAuE;EACnF,MAAMa,gBAAgBH,KAAKjB;EAC3B,MAAM,CAACqB,OAAOC,QAAQvC,WAAWwB,OAAO;GACtC;GACA;GACA;GACA;GACA;GACA;EAAU,CACX;EACD,OAAAE,gBACGW,eAAaG,WAAA;GAAA,KAAA,WAAA;IAAA,OACL5B,GACLT,UACA,GAAGF,sBAAsBqC,MAAMpB,YAAY,cAAc,GACzDoB,MAAMG,KACR;GAAC;GAAA,KAAA,uBAAA;IAAA,OACkBH,MAAMlB;GAAY;EAAA,GACjCmB,MAAI,EAAA,IAAAX,WAAA;GAAA,OAAA;IAAAF,gBAEPH,QAAM,EAAA,IAACE,OAAI;KAAA,OAAEa,MAAMjB;IAAM,EAAA,CAAA;IAAAsB,WACzBL,MAA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AAO,CAAC,SAAS,UAAU,CAAC;EAC7D,OAAAE,gBACGkC,qBAAmBpB,WAAA,EAAA,KAAA,WAAA;GAAA,OAAQ5B,GAAGT,UAAUmC,MAAMG,KAAK;EAAC,EAAA,GAAMF,MAAI,EAAA,IAAAX,WAAA;GAAA,OAAA,CAAAe,WAC5DL,MAAMV,QAAQ,GAAAF,gBACd9B,cAAY,EAAA,SAAA,iBAAA,CAAA,CAAA;EAAA,EAAA,CAAA,CAAA;CAGnB;CAEA,SAASiE,WAAWrC,OAA8D;EAChF,MAAM,EAAEqC,YAAYC,qBAAqBC,WAAW7B;EACpD,MAAM,CAACI,OAAOC,QAAQvC,WAAWwB,OAAO,CAAC,OAAO,CAAC;EACjD,OAAAE,gBACGqC,QAAM,EAAA,IAAAnC,WAAA;GAAA,OAAAF,gBACJoC,qBAAmBtB,WACd9B,eAAa,EAAA,KAAA,WAAA;IAAA,OACVE,GAAGG,WAAW,gBAAgBuB,MAAMG,KAAK;GAAC,EAAA,GAC7CF,IAAI,CAAA;EAAA,EAAA,CAAA;CAIhB;CAEA,OAAO;EAAEtB;EAAM6B;EAAUI;EAAcG;EAAWE;EAAOE;EAAWE;EAAYE;CAAW;AAC7F"}
@@ -1 +1 @@
1
- {"version":3,"file":"field.js","names":["TextField","KobalteTextField","ComponentProps","JSX","createUniqueId","Show","splitProps","Label","createFormFieldContext","FormFieldContext","cn","headingVariants","Field","props","local","rest","_$createComponent","_$mergeProps","class","FormFieldProps","Omit","label","hint","error","controlId","group","children","Element","FormField","fieldId","labelId","descriptionId","errorId","field","defaultControlId","help","when","_el$","_tmpl$","_$setAttribute","_$insert","_el$2","_tmpl$2","Provider","value","_el$3","_tmpl$3","_$spread","_c$","_$memo","FieldSet","aria-describedby","describedBy","aria-invalid","invalid","undefined","FieldLegend","id","variant","for","FieldLabel","FieldDescription","Description","FieldError","ErrorMessage","FieldInput","Input","FieldTextArea","TextArea","_el$4","_tmpl$4","FieldGroupProps","columns","FieldGroup","_el$5","_tmpl$5","_el$6","_tmpl$6","size","FieldSeparator","_el$7","_tmpl$8","_el$8","firstChild","_el$0","nextSibling","_el$9","_tmpl$7","_$createComponent","KobalteTextField","_$mergeProps","_$memo"],"sources":["../../../../src/components/ui/field/field.tsx"],"sourcesContent":["import { TextField as KobalteTextField } from '@kobalte/core/text-field'\nimport type { ComponentProps, JSX } from 'solid-js'\nimport { createUniqueId, Show, splitProps } from 'solid-js'\nimport { Label } from '../label/label'\nimport { createFormFieldContext, FormFieldContext } from '#lib/form-field'\nimport { cn } from '#lib/utils'\nimport { headingVariants } from '../typography'\n\n/**\n * Field.\n *\n * The wrapper that makes a form control describable and validatable: a label,\n * a description, an error message, and the ARIA relationships between them.\n *\n * This Kobalte TextField composition is for its own `FieldLabel`, `FieldInput`\n * and `FieldTextArea` parts. Use `FormField` to wire the standalone shared\n * controls, including checkboxes, switches and comboboxes.\n *\n * It is built on Kobalte's TextField specifically so `aria-describedby`,\n * `aria-invalid` and `aria-errormessage` are wired by construction. Those three\n * attributes are the difference between \"this field is required and empty\" and\n * a red border that only a sighted user can perceive — and they are also the\n * first thing a hand-rolled form drops.\n *\n * `Field` owns the description and the error slot, so its controls line up and\n * its messages land in the same place regardless of which TextField part is used.\n */\nexport function Field(props: ComponentProps<typeof KobalteTextField>) {\n const [local, rest] = splitProps(props, ['class'])\n return <KobalteTextField class={cn('flex flex-col gap-1.5', local.class)} {...rest} />\n}\n\nexport type FormFieldProps = Omit<ComponentProps<'div'>, 'children' | 'ref'> & {\n label: string\n hint?: string\n error?: string\n controlId?: string\n group?: boolean\n children: JSX.Element\n}\n\n/**\n * FormField.\n *\n * A shared label, help and validation wrapper for any one shared control. Its\n * context is consumed by Input, Textarea, NativeSelect, Checkbox, Switch,\n * RadioGroup and ComboboxInput, so the actual focusable element receives the\n * generated ID and description relationships. Set `group` when the label names\n * a set of controls; the wrapper then uses fieldset and legend semantics.\n */\nexport function FormField(props: FormFieldProps) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'label',\n 'hint',\n 'error',\n 'controlId',\n 'group',\n 'children',\n ])\n const fieldId = createUniqueId()\n const labelId = `${fieldId}-label`\n const descriptionId = `${fieldId}-description`\n const errorId = `${fieldId}-error`\n const field = createFormFieldContext({\n controlId: local.controlId,\n defaultControlId: fieldId,\n labelId,\n descriptionId,\n errorId,\n hint: () => local.hint,\n error: () => local.error,\n group: () => local.group ?? false,\n })\n const help = () => (\n <>\n <Show when={local.hint}>\n <p id={descriptionId} class=\"text-muted-foreground text-sm\">\n {local.hint}\n </p>\n </Show>\n <Show when={local.error}>\n <p id={errorId} role=\"alert\" class=\"text-foreground text-sm\">\n {local.error}\n </p>\n </Show>\n </>\n )\n\n return (\n <FormFieldContext.Provider value={field}>\n <div class={cn('flex flex-col gap-1.5', local.class)} {...rest}>\n {local.group ? (\n <FieldSet\n class=\"flex flex-col gap-1.5\"\n aria-describedby={field.describedBy()}\n aria-invalid={field.invalid() || undefined}\n >\n <FieldLegend id={labelId} variant=\"label\">\n {local.label}\n </FieldLegend>\n {local.children}\n {help()}\n </FieldSet>\n ) : (\n <>\n <Label id={labelId} for={field.controlId()}>\n {local.label}\n </Label>\n {local.children}\n {help()}\n </>\n )}\n </div>\n </FormFieldContext.Provider>\n )\n}\n\nexport function FieldLabel(props: ComponentProps<typeof KobalteTextField.Label>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <KobalteTextField.Label class={cn('text-sm leading-none font-medium', local.class)} {...rest} />\n )\n}\n\nexport function FieldDescription(props: ComponentProps<typeof KobalteTextField.Description>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <KobalteTextField.Description\n class={cn('text-muted-foreground text-sm', local.class)}\n {...rest}\n />\n )\n}\n\nexport function FieldError(props: ComponentProps<typeof KobalteTextField.ErrorMessage>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <KobalteTextField.ErrorMessage class={cn('text-foreground text-sm', local.class)} {...rest} />\n )\n}\n\nexport function FieldInput(props: ComponentProps<typeof KobalteTextField.Input>) {\n const [local, rest] = splitProps(props, ['class'])\n\n return (\n <KobalteTextField.Input\n class={cn(\n 'h-control-md w-full min-w-0 rounded-md border border-input bg-transparent px-control-md py-1 text-sm',\n 'transition-[color,box-shadow,border-color] ease-out outline-none',\n 'placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground',\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',\n local.class\n )}\n {...rest}\n />\n )\n}\n\nexport function FieldTextArea(props: ComponentProps<typeof KobalteTextField.TextArea>) {\n const [local, rest] = splitProps(props, ['class'])\n\n return (\n <KobalteTextField.TextArea\n class={cn(\n 'flex field-sizing-content min-h-16 w-full rounded-md border border-input bg-transparent px-control-md py-2 text-sm',\n 'transition-[color,box-shadow,border-color] ease-out outline-none resize-y',\n 'placeholder:text-muted-foreground',\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',\n local.class\n )}\n {...rest}\n />\n )\n}\n\n/**\n * A labelled group of fields with a single legend, for a real `<fieldset>`.\n * Grouping is what lets a screen reader announce \"Shipping address, group\"\n * before reading the four fields inside it.\n */\nexport function FieldSet(props: ComponentProps<'fieldset'>) {\n const [local, rest] = splitProps(props, ['class'])\n return <fieldset class={cn('flex flex-col gap-4', local.class)} {...rest} />\n}\n\nexport type FieldGroupProps = ComponentProps<'div'> & {\n /**\n * `2` lays the fields out in two columns from the `sm` breakpoint up — a\n * short form of paired values (host and port, a name and a model). A field\n * that needs the full width says `class=\"col-span-full\"`. Below `sm` it is\n * one column again, because two inputs side by side on a phone are each too\n * narrow to read.\n *\n * `3` is the same grid with three columns from `sm`, for a row of short values\n * (a trio of limits, a day count and two thresholds). Each column is a third of\n * the group, so reach for `2` when a field holds a path, a URL or a sentence.\n */\n columns?: 1 | 2 | 3\n}\n\n/** A visual stack for related controls that does not imply fieldset semantics. */\nexport function FieldGroup(props: FieldGroupProps) {\n const [local, rest] = splitProps(props, ['class', 'columns'])\n return (\n <div\n data-slot=\"field-group\"\n class={cn(\n {\n 'grid gap-4 sm:grid-cols-2': local.columns === 2,\n 'grid gap-4 sm:grid-cols-3': local.columns === 3,\n 'flex flex-col gap-4': local.columns !== 2 && local.columns !== 3,\n },\n local.class\n )}\n {...rest}\n />\n )\n}\n\nexport function FieldLegend(props: ComponentProps<'legend'> & { variant?: 'legend' | 'label' }) {\n const [local, rest] = splitProps(props, ['class', 'variant'])\n return (\n <legend\n class={cn(\n 'mb-1',\n local.variant === 'label' ? 'text-sm font-medium' : headingVariants({ size: 'card' }),\n local.class\n )}\n {...rest}\n />\n )\n}\n\n/** A horizontal rule with a word in it, for \"or continue with\" separators. */\nexport function FieldSeparator(props: {\n class?: string\n children?: ComponentProps<'span'>['children']\n}) {\n const [local, rest] = splitProps(props, ['class', 'children'])\n\n return (\n <div class={cn('relative flex items-center gap-3 py-1', local.class)} {...rest}>\n <span class=\"bg-border h-px flex-1\" />\n <Show when={local.children}>\n <span class=\"text-muted-foreground text-2xs tracking-wide uppercase\">{local.children}</span>\n </Show>\n <span class=\"bg-border h-px flex-1\" />\n </div>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,SAAgBY,MAAMC,OAAgD;CACpE,MAAM,CAACC,OAAOC,QAAQT,WAAWO,OAAO,CAAC,OAAO,CAAC;CACjD,OAAAG,gBAAQf,WAAgBgB,WAAA,EAAA,KAAA,WAAA;EAAA,OAAQP,GAAG,yBAAyBI,MAAMI,KAAK;CAAC,EAAA,GAAMH,IAAI,CAAA;AACpF;;;;;;;;;;AAoBA,SAAgBa,UAAUf,OAAuB;CAC/C,MAAM,CAACC,OAAOC,QAAQT,WAAWO,OAAO;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I,KACR;EAAC,EAAA,GACGH,IAAI,GAAA,OAAA,KAAA;EAAA,OAAA2D;CAAA,EAAA,CAAA;AAGd;AAEA,SAAgBlB,YAAY3C,OAAoE;CAC9F,MAAM,CAACC,OAAOC,QAAQT,WAAWO,OAAO,CAAC,SAAS,SAAS,CAAC;CAC5D,cAAA;EAAA,IAAA+D,QAAAC,QAAA;EAAA9B,OAAA6B,OAAA3D,WAAA,EAAA,KAAA,WAAA;GAAA,OAEWP,GACL,QACAI,MAAM4C,YAAY,UAAU,wBAAwB/C,gBAAgB,EAAEmE,MAAM,OAAO,CAAC,GACpFhE,MAAMI,KACR;EAAC,EAAA,GACGH,IAAI,GAAA,OAAA,KAAA;EAAA,OAAA6D;CAAA,EAAA,CAAA;AAGd;;AAGA,SAAgBG,eAAelE,OAG5B;CACD,MAAM,CAACC,OAAOC,QAAQT,WAAWO,OAAO,CAAC,SAAS,UAAU,CAAC;CAE7D,cAAA;EAAA,IAAAmE,QAAAC,QAAA,GAAAG,QAAAJ,MAAAG,WAAAE;EAAAtC,OAAAiC,OAAA/D,WAAA,EAAA,KAAA,WAAA;GAAA,OACcP,GAAG,yCAAyCI,MAAMI,KAAK;EAAC,EAAA,GAAMH,IAAI,GAAA,OAAA,IAAA;EAAAyB,OAAAwC,OAAAhE,gBAE3EX,MAAI;GAAA,IAAC+B,OAAI;IAAA,OAAEtB,MAAMY;GAAQ;GAAA,IAAAA,WAAA;IAAA,IAAA4D,QAAAC,QAAA;IAAA/C,OAAA8C,aAC8CxE,MAAMY,QAAQ;IAAA,OAAA4D;GAAA;EAAA,CAAA,GAAAF,KAAA;EAAA,OAAAJ;CAAA,EAAA,CAAA;AAK5F"}
1
+ {"version":3,"file":"field.js","names":["TextField","KobalteTextField","ComponentProps","JSX","createUniqueId","Show","splitProps","Label","createFormFieldContext","FormFieldContext","cn","headingVariants","Field","props","local","rest","_$createComponent","_$mergeProps","class","FormFieldProps","Omit","label","hint","error","controlId","group","children","Element","FormField","fieldId","labelId","descriptionId","errorId","field","defaultControlId","help","when","_el$","_tmpl$","_$setAttribute","_$insert","_el$2","_tmpl$2","Provider","value","_el$3","_tmpl$3","_$spread","_c$","_$memo","FieldSet","aria-describedby","describedBy","aria-invalid","invalid","undefined","FieldLegend","id","variant","for","FieldLabel","FieldDescription","Description","FieldError","ErrorMessage","FieldInput","Input","FieldTextArea","TextArea","_el$4","_tmpl$4","FieldGroupProps","columns","FieldGroup","_el$5","_tmpl$5","_el$6","_tmpl$6","size","FieldSeparator","_el$7","_tmpl$8","_el$8","firstChild","_el$0","nextSibling","_el$9","_tmpl$7","_$createComponent","KobalteTextField","_$mergeProps","_$memo"],"sources":["../../../../src/components/ui/field/field.tsx"],"sourcesContent":["import { TextField as KobalteTextField } from '@kobalte/core/text-field'\nimport type { ComponentProps, JSX } from 'solid-js'\nimport { createUniqueId, Show, splitProps } from 'solid-js'\nimport { Label } from '../label'\nimport { createFormFieldContext, FormFieldContext } from '#lib/form-field'\nimport { cn } from '#lib/utils'\nimport { headingVariants } from '../typography'\n\n/**\n * Field.\n *\n * The wrapper that makes a form control describable and validatable: a label,\n * a description, an error message, and the ARIA relationships between them.\n *\n * This Kobalte TextField composition is for its own `FieldLabel`, `FieldInput`\n * and `FieldTextArea` parts. Use `FormField` to wire the standalone shared\n * controls, including checkboxes, switches and comboboxes.\n *\n * It is built on Kobalte's TextField specifically so `aria-describedby`,\n * `aria-invalid` and `aria-errormessage` are wired by construction. Those three\n * attributes are the difference between \"this field is required and empty\" and\n * a red border that only a sighted user can perceive — and they are also the\n * first thing a hand-rolled form drops.\n *\n * `Field` owns the description and the error slot, so its controls line up and\n * its messages land in the same place regardless of which TextField part is used.\n */\nexport function Field(props: ComponentProps<typeof KobalteTextField>) {\n const [local, rest] = splitProps(props, ['class'])\n return <KobalteTextField class={cn('flex flex-col gap-1.5', local.class)} {...rest} />\n}\n\nexport type FormFieldProps = Omit<ComponentProps<'div'>, 'children' | 'ref'> & {\n label: string\n hint?: string\n error?: string\n controlId?: string\n group?: boolean\n children: JSX.Element\n}\n\n/**\n * FormField.\n *\n * A shared label, help and validation wrapper for any one shared control. Its\n * context is consumed by Input, Textarea, NativeSelect, Checkbox, Switch,\n * RadioGroup and ComboboxInput, so the actual focusable element receives the\n * generated ID and description relationships. Set `group` when the label names\n * a set of controls; the wrapper then uses fieldset and legend semantics.\n */\nexport function FormField(props: FormFieldProps) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'label',\n 'hint',\n 'error',\n 'controlId',\n 'group',\n 'children',\n ])\n const fieldId = createUniqueId()\n const labelId = `${fieldId}-label`\n const descriptionId = `${fieldId}-description`\n const errorId = `${fieldId}-error`\n const field = createFormFieldContext({\n controlId: local.controlId,\n defaultControlId: fieldId,\n labelId,\n descriptionId,\n errorId,\n hint: () => local.hint,\n error: () => local.error,\n group: () => local.group ?? false,\n })\n const help = () => (\n <>\n <Show when={local.hint}>\n <p id={descriptionId} class=\"text-muted-foreground text-sm\">\n {local.hint}\n </p>\n </Show>\n <Show when={local.error}>\n <p id={errorId} role=\"alert\" class=\"text-foreground text-sm\">\n {local.error}\n </p>\n </Show>\n </>\n )\n\n return (\n <FormFieldContext.Provider value={field}>\n <div class={cn('flex flex-col gap-1.5', local.class)} {...rest}>\n {local.group ? (\n <FieldSet\n class=\"flex flex-col gap-1.5\"\n aria-describedby={field.describedBy()}\n aria-invalid={field.invalid() || undefined}\n >\n <FieldLegend id={labelId} variant=\"label\">\n {local.label}\n </FieldLegend>\n {local.children}\n {help()}\n </FieldSet>\n ) : (\n <>\n <Label id={labelId} for={field.controlId()}>\n {local.label}\n </Label>\n {local.children}\n {help()}\n </>\n )}\n </div>\n </FormFieldContext.Provider>\n )\n}\n\nexport function FieldLabel(props: ComponentProps<typeof KobalteTextField.Label>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <KobalteTextField.Label class={cn('text-sm leading-none font-medium', local.class)} {...rest} />\n )\n}\n\nexport function FieldDescription(props: ComponentProps<typeof KobalteTextField.Description>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <KobalteTextField.Description\n class={cn('text-muted-foreground text-sm', local.class)}\n {...rest}\n />\n )\n}\n\nexport function FieldError(props: ComponentProps<typeof KobalteTextField.ErrorMessage>) {\n const [local, rest] = splitProps(props, ['class'])\n return (\n <KobalteTextField.ErrorMessage class={cn('text-foreground text-sm', local.class)} {...rest} />\n )\n}\n\nexport function FieldInput(props: ComponentProps<typeof KobalteTextField.Input>) {\n const [local, rest] = splitProps(props, ['class'])\n\n return (\n <KobalteTextField.Input\n class={cn(\n 'h-control-md w-full min-w-0 rounded-md border border-input bg-transparent px-control-md py-1 text-sm',\n 'transition-[color,box-shadow,border-color] ease-out outline-none',\n 'placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground',\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',\n local.class\n )}\n {...rest}\n />\n )\n}\n\nexport function FieldTextArea(props: ComponentProps<typeof KobalteTextField.TextArea>) {\n const [local, rest] = splitProps(props, ['class'])\n\n return (\n <KobalteTextField.TextArea\n class={cn(\n 'flex field-sizing-content min-h-16 w-full rounded-md border border-input bg-transparent px-control-md py-2 text-sm',\n 'transition-[color,box-shadow,border-color] ease-out outline-none resize-y',\n 'placeholder:text-muted-foreground',\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',\n local.class\n )}\n {...rest}\n />\n )\n}\n\n/**\n * A labelled group of fields with a single legend, for a real `<fieldset>`.\n * Grouping is what lets a screen reader announce \"Shipping address, group\"\n * before reading the four fields inside it.\n */\nexport function FieldSet(props: ComponentProps<'fieldset'>) {\n const [local, rest] = splitProps(props, ['class'])\n return <fieldset class={cn('flex flex-col gap-4', local.class)} {...rest} />\n}\n\nexport type FieldGroupProps = ComponentProps<'div'> & {\n /**\n * `2` lays the fields out in two columns from the `sm` breakpoint up — a\n * short form of paired values (host and port, a name and a model). A field\n * that needs the full width says `class=\"col-span-full\"`. Below `sm` it is\n * one column again, because two inputs side by side on a phone are each too\n * narrow to read.\n *\n * `3` is the same grid with three columns from `sm`, for a row of short values\n * (a trio of limits, a day count and two thresholds). Each column is a third of\n * the group, so reach for `2` when a field holds a path, a URL or a sentence.\n */\n columns?: 1 | 2 | 3\n}\n\n/** A visual stack for related controls that does not imply fieldset semantics. */\nexport function FieldGroup(props: FieldGroupProps) {\n const [local, rest] = splitProps(props, ['class', 'columns'])\n return (\n <div\n data-slot=\"field-group\"\n class={cn(\n {\n 'grid gap-4 sm:grid-cols-2': local.columns === 2,\n 'grid gap-4 sm:grid-cols-3': local.columns === 3,\n 'flex flex-col gap-4': local.columns !== 2 && local.columns !== 3,\n },\n local.class\n )}\n {...rest}\n />\n )\n}\n\nexport function FieldLegend(props: ComponentProps<'legend'> & { variant?: 'legend' | 'label' }) {\n const [local, rest] = splitProps(props, ['class', 'variant'])\n return (\n <legend\n class={cn(\n 'mb-1',\n local.variant === 'label' ? 'text-sm font-medium' : headingVariants({ size: 'card' }),\n local.class\n )}\n {...rest}\n />\n )\n}\n\n/** A horizontal rule with a word in it, for \"or continue with\" separators. */\nexport function FieldSeparator(props: {\n class?: string\n children?: ComponentProps<'span'>['children']\n}) {\n const [local, rest] = splitProps(props, ['class', 'children'])\n\n return (\n <div class={cn('relative flex items-center gap-3 py-1', local.class)} {...rest}>\n <span class=\"bg-border h-px flex-1\" />\n <Show when={local.children}>\n <span class=\"text-muted-foreground text-2xs tracking-wide uppercase\">{local.children}</span>\n </Show>\n <span class=\"bg-border h-px flex-1\" />\n </div>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,SAAgBY,MAAMC,OAAgD;CACpE,MAAM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A,OAAA4D;GAAA;EAAA,CAAA,GAAAF,KAAA;EAAA,OAAAJ;CAAA,EAAA,CAAA;AAK5F"}
@@ -1 +1 @@
1
- {"version":3,"file":"number-field.js","names":["createEffect","createSignal","JSX","FormField","Input","NumberFieldBaseProps","label","hint","min","max","step","integer","disabled","class","onBlur","EventHandler","HTMLInputElement","FocusEvent","NumberFieldProps","optional","value","onChange","text","String","NumberField","props","draft","setDraft","error","setError","undefined","Number","isInteger","validate","raw","badInput","next","isFinite","steps","Math","abs","round","_$createComponent","children","type","required","onInput","event","currentTarget","validity","nextError","_$createComponent"],"sources":["../../../../src/components/ui/field/number-field.tsx"],"sourcesContent":["import { createEffect, createSignal, type JSX } from 'solid-js'\nimport { FormField } from './field'\nimport { Input } from '../input/input'\n\ntype NumberFieldBaseProps = {\n label: string\n hint?: string\n min: number\n max: number\n /**\n * The increment of the spinner and the arrow keys, and the grid a typed value\n * must sit on: `min` plus a whole number of steps. Use it for stepped or\n * fractional values (`0.05` for a 0-1 score, `5` for a percentage in fives).\n * Without it a field steps by 1, or by `any` when `integer` is `false`, which\n * accepts every decimal but leaves the spinner moving in whole numbers.\n */\n step?: number\n /**\n * Whether only whole numbers are valid. It defaults to `true`, or, when a\n * `step` is given, to whether both the step and its base `min` are whole\n * numbers, so `step={0.05}` accepts decimals without also saying\n * `integer={false}`, and `min={0.5} step={1}` accepts 0.5, 1.5, 2.5.\n */\n integer?: boolean\n /** Locks the input; a locked field keeps its value and reports nothing. */\n disabled?: boolean\n class?: string\n onBlur?: JSX.EventHandler<HTMLInputElement, FocusEvent>\n}\n\nexport type NumberFieldProps = NumberFieldBaseProps &\n (\n | {\n optional?: false\n value: number\n onChange: (value: number) => void\n }\n | {\n /**\n * Lets the field be left blank: a blank field is valid and reports `null`,\n * and a `null` value shows a blank field. Use it for a limit that falls\n * back to a default when unset, so a caller never maps `''` to\n * `undefined` of its own.\n */\n optional: true\n value: number | null\n onChange: (value: number | null) => void\n }\n )\n\nconst text = (value: number | null) => (value === null ? '' : String(value))\n\n/**\n * A controlled numeric field that keeps an editable draft while validating\n * range, integer and step constraints. Invalid drafts are announced and restored\n * to the latest controlled value when focus leaves the input, so `onChange`\n * only ever receives a value the field accepts — a caller never needs a\n * `Number(value) || fallback` of its own. With `optional`, blank is accepted and\n * reported as `null`.\n */\nexport function NumberField(props: NumberFieldProps) {\n const [draft, setDraft] = createSignal(text(props.value))\n const [error, setError] = createSignal('')\n // Whole numbers only when nothing on the grid is fractional: a whole step from\n // a fractional `min` (0.5, 1.5, 2.5) puts the spinner's own values off the\n // integers, so inference needs the step and its base to both be whole.\n const integer = () =>\n props.integer ??\n (props.step === undefined || (Number.isInteger(props.step) && Number.isInteger(props.min)))\n\n createEffect(() => {\n setDraft(text(props.value))\n })\n\n // A number input reports '' both when it is empty and when it holds text it cannot parse\n // (\"abc\", \"-\", \"1e\"); only `validity.badInput` tells them apart, and a bad draft must never\n // count as blank (it would report `null` and clear the limit).\n const validate = (raw: string, badInput: boolean) => {\n if (badInput) return `${props.label} must be a valid number.`\n if (!raw) return props.optional ? '' : `${props.label} is required.`\n const next = Number(raw)\n if (!Number.isFinite(next)) return `${props.label} must be a valid number.`\n if (integer() && !Number.isInteger(next)) {\n return `${props.label} must be a whole number.`\n }\n if (next < props.min || next > props.max) {\n return `${props.label} must be between ${props.min} and ${props.max}.`\n }\n if (props.step !== undefined && props.step > 0) {\n // Compare in whole steps with a tolerance: 0.15 / 0.05 is 3.0000000000000004,\n // and rejecting it would make the spinner's own values invalid.\n const steps = (next - props.min) / props.step\n if (Math.abs(steps - Math.round(steps)) > 1e-9) {\n return props.min === 0\n ? `${props.label} must be a multiple of ${props.step}.`\n : `${props.label} must be ${props.min} plus a multiple of ${props.step}.`\n }\n }\n return ''\n }\n\n return (\n <FormField label={props.label} hint={props.hint} error={error()} class={props.class}>\n <Input\n type=\"number\"\n value={draft()}\n min={props.min}\n max={props.max}\n step={props.step ?? (integer() ? 1 : 'any')}\n required={!props.optional}\n disabled={props.disabled}\n onInput={(event) => {\n const raw = event.currentTarget.value\n // Read before touching the draft: writing '' back to the input would clear the entry and\n // with it `badInput`. An unparsable entry keeps the last draft and the text on screen, so\n // the user can correct it; blur restores the last good value.\n const badInput = event.currentTarget.validity.badInput\n if (!badInput) setDraft(raw)\n const nextError = validate(raw, badInput)\n setError(nextError)\n if (nextError) return\n // `optional` narrows the callback to `number | null`; a required field never sees `''`.\n ;(props.onChange as (value: number | null) => void)(raw ? Number(raw) : null)\n }}\n onBlur={(event) => {\n const nextError = validate(draft(), event.currentTarget.validity.badInput)\n if (nextError) {\n setDraft(text(props.value))\n setError('')\n // The draft of an unparsable entry is '' and so is the restored blank value: the signal\n // does not change, so the DOM has to be reset by hand to drop the leftover text.\n event.currentTarget.value = text(props.value)\n }\n props.onBlur?.(event)\n }}\n />\n </FormField>\n )\n}\n"],"mappings":";;;;;AAkDA,IAAMsB,QAAQF,UAA0BA,UAAU,OAAO,KAAKG,OAAOH,KAAK;;;;;;;;;AAU1E,SAAgBI,YAAYC,OAAyB;CACnD,MAAM,CAACC,OAAOC,YAAY1B,aAAaqB,KAAKG,MAAML,KAAK,CAAC;CACxD,MAAM,CAACQ,OAAOC,YAAY5B,aAAa,EAAE;CAIzC,MAAMU,gBACJc,MAAMd,YACLc,MAAMf,SAASoB,KAAAA,KAAcC,OAAOC,UAAUP,MAAMf,IAAI,KAAKqB,OAAOC,UAAUP,MAAMjB,GAAG;CAE1FR,mBAAmB;EACjB2B,SAASL,KAAKG,MAAML,KAAK,CAAC;CAC5B,CAAC;CAKD,MAAMa,YAAYC,KAAaC,aAAsB;EACnD,IAAIA,UAAU,OAAO,GAAGV,MAAMnB,MAAK;EACnC,IAAI,CAAC4B,KAAK,OAAOT,MAAMN,WAAW,KAAK,GAAGM,MAAMnB,MAAK;EACrD,MAAM8B,OAAOL,OAAOG,GAAG;EACvB,IAAI,CAACH,OAAOM,SAASD,IAAI,GAAG,OAAO,GAAGX,MAAMnB,MAAK;EACjD,IAAIK,QAAQ,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WAAWY,MAAMC,cAAcC,SAASd;KAC9C,IAAI,CAACA,UAAUR,SAASO,GAAG;KAC3B,MAAMgB,YAAYjB,SAASC,KAAKC,QAAQ;KACxCN,SAASqB,SAAS;KAClB,IAAIA,WAAW;KAEd,MAAO7B,SAA4Ca,MAAMH,OAAOG,GAAG,IAAI,IAAI;IAC9E;IACApB,SAASiC,UAAU;KAEjB,IADkBd,SAASP,MAAM,GAAGqB,MAAMC,cAAcC,SAASd,QAC7De,GAAW;MACbvB,SAASL,KAAKG,MAAML,KAAK,CAAC;MAC1BS,SAAS,EAAE;MAGXkB,MAAMC,cAAc5B,QAAQE,KAAKG,MAAML,KAAK;KAC9C;KACAK,MAAMX,SAASiC,KAAK;IACtB;GAAC,CAAA;EAAA;CAAA,CAAA;AAIT"}
1
+ {"version":3,"file":"number-field.js","names":["createEffect","createSignal","JSX","FormField","Input","NumberFieldBaseProps","label","hint","min","max","step","integer","disabled","class","onBlur","EventHandler","HTMLInputElement","FocusEvent","NumberFieldProps","optional","value","onChange","text","String","NumberField","props","draft","setDraft","error","setError","undefined","Number","isInteger","validate","raw","badInput","next","isFinite","steps","Math","abs","round","_$createComponent","children","type","required","onInput","event","currentTarget","validity","nextError","_$createComponent"],"sources":["../../../../src/components/ui/field/number-field.tsx"],"sourcesContent":["import { createEffect, createSignal, type JSX } from 'solid-js'\nimport { FormField } from './field'\nimport { Input } from '../input'\n\ntype NumberFieldBaseProps = {\n label: string\n hint?: string\n min: number\n max: number\n /**\n * The increment of the spinner and the arrow keys, and the grid a typed value\n * must sit on: `min` plus a whole number of steps. Use it for stepped or\n * fractional values (`0.05` for a 0-1 score, `5` for a percentage in fives).\n * Without it a field steps by 1, or by `any` when `integer` is `false`, which\n * accepts every decimal but leaves the spinner moving in whole numbers.\n */\n step?: number\n /**\n * Whether only whole numbers are valid. It defaults to `true`, or, when a\n * `step` is given, to whether both the step and its base `min` are whole\n * numbers, so `step={0.05}` accepts decimals without also saying\n * `integer={false}`, and `min={0.5} step={1}` accepts 0.5, 1.5, 2.5.\n */\n integer?: boolean\n /** Locks the input; a locked field keeps its value and reports nothing. */\n disabled?: boolean\n class?: string\n onBlur?: JSX.EventHandler<HTMLInputElement, FocusEvent>\n}\n\nexport type NumberFieldProps = NumberFieldBaseProps &\n (\n | {\n optional?: false\n value: number\n onChange: (value: number) => void\n }\n | {\n /**\n * Lets the field be left blank: a blank field is valid and reports `null`,\n * and a `null` value shows a blank field. Use it for a limit that falls\n * back to a default when unset, so a caller never maps `''` to\n * `undefined` of its own.\n */\n optional: true\n value: number | null\n onChange: (value: number | null) => void\n }\n )\n\nconst text = (value: number | null) => (value === null ? '' : String(value))\n\n/**\n * A controlled numeric field that keeps an editable draft while validating\n * range, integer and step constraints. Invalid drafts are announced and restored\n * to the latest controlled value when focus leaves the input, so `onChange`\n * only ever receives a value the field accepts — a caller never needs a\n * `Number(value) || fallback` of its own. With `optional`, blank is accepted and\n * reported as `null`.\n */\nexport function NumberField(props: NumberFieldProps) {\n const [draft, setDraft] = createSignal(text(props.value))\n const [error, setError] = createSignal('')\n // Whole numbers only when nothing on the grid is fractional: a whole step from\n // a fractional `min` (0.5, 1.5, 2.5) puts the spinner's own values off the\n // integers, so inference needs the step and its base to both be whole.\n const integer = () =>\n props.integer ??\n (props.step === undefined || (Number.isInteger(props.step) && Number.isInteger(props.min)))\n\n createEffect(() => {\n setDraft(text(props.value))\n })\n\n // A number input reports '' both when it is empty and when it holds text it cannot parse\n // (\"abc\", \"-\", \"1e\"); only `validity.badInput` tells them apart, and a bad draft must never\n // count as blank (it would report `null` and clear the limit).\n const validate = (raw: string, badInput: boolean) => {\n if (badInput) return `${props.label} must be a valid number.`\n if (!raw) return props.optional ? '' : `${props.label} is required.`\n const next = Number(raw)\n if (!Number.isFinite(next)) return `${props.label} must be a valid number.`\n if (integer() && !Number.isInteger(next)) {\n return `${props.label} must be a whole number.`\n }\n if (next < props.min || next > props.max) {\n return `${props.label} must be between ${props.min} and ${props.max}.`\n }\n if (props.step !== undefined && props.step > 0) {\n // Compare in whole steps with a tolerance: 0.15 / 0.05 is 3.0000000000000004,\n // and rejecting it would make the spinner's own values invalid.\n const steps = (next - props.min) / props.step\n if (Math.abs(steps - Math.round(steps)) > 1e-9) {\n return props.min === 0\n ? `${props.label} must be a multiple of ${props.step}.`\n : `${props.label} must be ${props.min} plus a multiple of ${props.step}.`\n }\n }\n return ''\n }\n\n return (\n <FormField label={props.label} hint={props.hint} error={error()} class={props.class}>\n <Input\n type=\"number\"\n value={draft()}\n min={props.min}\n max={props.max}\n step={props.step ?? (integer() ? 1 : 'any')}\n required={!props.optional}\n disabled={props.disabled}\n onInput={(event) => {\n const raw = event.currentTarget.value\n // Read before touching the draft: writing '' back to the input would clear the entry and\n // with it `badInput`. An unparsable entry keeps the last draft and the text on screen, so\n // the user can correct it; blur restores the last good value.\n const badInput = event.currentTarget.validity.badInput\n if (!badInput) setDraft(raw)\n const nextError = validate(raw, badInput)\n setError(nextError)\n if (nextError) return\n // `optional` narrows the callback to `number | null`; a required field never sees `''`.\n ;(props.onChange as (value: number | null) => void)(raw ? Number(raw) : null)\n }}\n onBlur={(event) => {\n const nextError = validate(draft(), event.currentTarget.validity.badInput)\n if (nextError) {\n setDraft(text(props.value))\n setError('')\n // The draft of an unparsable entry is '' and so is the restored blank value: the signal\n // does not change, so the DOM has to be reset by hand to drop the leftover text.\n event.currentTarget.value = text(props.value)\n }\n props.onBlur?.(event)\n }}\n />\n </FormField>\n )\n}\n"],"mappings":";;;;;AAkDA,IAAMsB,QAAQF,UAA0BA,UAAU,OAAO,KAAKG,OAAOH,KAAK;;;;;;;;;AAU1E,SAAgBI,YAAYC,OAAyB;CACnD,MAAM,CAACC,OAAOC,YAAY1B,aAAaqB,KAAKG,MAAML,KAAK,CAAC;CACxD,MAAM,CAACQ,OAAOC,YAAY5B,aAAa,EAAE;CAIzC,MAAMU,gBACJc,MAAMd,YACLc,MAAMf,SAASoB,KAAAA,KAAcC,OAAOC,UAAUP,MAAMf,IAAI,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AI;IAAA,IACJxB,QAAK;KAAA,OAAEM,MAAM;IAAC;IAAA,IACdlB,MAAG;KAAA,OAAEiB,MAAMjB;IAAG;IAAA,IACdC,MAAG;KAAA,OAAEgB,MAAMhB;IAAG;IAAA,IACdC,OAAI;KAAA,OAAEe,MAAMf,SAASC,QAAQ,IAAI,IAAI;IAAM;IAAA,IAC3CkC,WAAQ;KAAA,OAAE,CAACpB,MAAMN;IAAQ;IAAA,IACzBP,WAAQ;KAAA,OAAEa,MAAMb;IAAQ;IACxBkC,UAAUC,UAAU;KAClB,MAAMb,MAAMa,MAAMC,cAAc5B;KAIhC,MAAMe,WAAWY,MAAMC,cAAcC,SAASd;KAC9C,IAAI,CAACA,UAAUR,SAASO,GAAG;KAC3B,MAAMgB,YAAYjB,SAASC,KAAKC,QAAQ;KACxCN,SAASqB,SAAS;KAClB,IAAIA,WAAW;KAEd,MAAO7B,SAA4Ca,MAAMH,OAAOG,GAAG,IAAI,IAAI;IAC9E;IACApB,SAASiC,UAAU;KAEjB,IADkBd,SAASP,MAAM,GAAGqB,MAAMC,cAAcC,SAASd,QAC7De,GAAW;MACbvB,SAASL,KAAKG,MAAML,KAAK,CAAC;MAC1BS,SAAS,EAAE;MAGXkB,MAAMC,cAAc5B,QAAQE,KAAKG,MAAML,KAAK;KAC9C;KACAK,MAAMX,SAASiC,KAAK;IACtB;GAAC,CAAA;EAAA;CAAA,CAAA;AAIT"}
@@ -11,7 +11,6 @@ import type { ComponentProps } from 'solid-js';
11
11
  * way (clicking the trigger, for instance). A hover card that holds the only
12
12
  * route to something is unreachable by keyboard and by touch.
13
13
  */
14
- export declare function HoverCard(props: ComponentProps<typeof KobalteHoverCard>): import("solid-js").JSX.Element;
15
- export declare function HoverCardTrigger(props: ComponentProps<typeof KobalteHoverCard.Trigger>): import("solid-js").JSX.Element;
14
+ export { Root as HoverCard, Trigger as HoverCardTrigger } from '@kobalte/core/hover-card';
16
15
  export declare function HoverCardContent(props: ComponentProps<typeof KobalteHoverCard.Content>): import("solid-js").JSX.Element;
17
16
  //# sourceMappingURL=hover-card.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"hover-card.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/hover-card/hover-card.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,IAAI,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AACxE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAK9C;;;;;;;;;;GAUG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,gBAAgB,CAAC,kCAEvE;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,gBAAgB,CAAC,OAAO,CAAC,kCAEtF;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,gBAAgB,CAAC,OAAO,CAAC,kCAsBtF"}
1
+ {"version":3,"file":"hover-card.d.ts","sourceRoot":"","sources":["../../../../src/components/ui/hover-card/hover-card.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,IAAI,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AACxE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAK9C;;;;;;;;;;GAUG;AACH,OAAO,EAAE,IAAI,IAAI,SAAS,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAEzF,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,cAAc,CAAC,OAAO,gBAAgB,CAAC,OAAO,CAAC,kCAqBtF"}
@@ -1,31 +1,14 @@
1
- import { overlaySurface, popoverArrow } from "../../../lib/overlay.js";
1
+ import { overlaySurface, popoverArrow, tooltipMotion, topLayerProps } from "../../../lib/overlay.js";
2
2
  import { cn } from "../../../lib/utils.js";
3
3
  import { createComponent, memo, mergeProps } from "solid-js/web";
4
4
  import { splitProps } from "solid-js";
5
- import { HoverCard } from "@kobalte/core/hover-card";
5
+ import { HoverCard, Root as HoverCard$1, Trigger as HoverCardTrigger } from "@kobalte/core/hover-card";
6
6
  // src/components/ui/hover-card/hover-card.tsx
7
- /**
8
- * HoverCard.
9
- *
10
- * A rich preview shown on hover: a user's profile, a file's summary, a link's
11
- * destination. The difference from Tooltip is that this may be hovered *into*
12
- * — the pointer can leave the trigger, cross the gap, and read the card.
13
- *
14
- * Because it only opens on hover, its content must also be reachable another
15
- * way (clicking the trigger, for instance). A hover card that holds the only
16
- * route to something is unreachable by keyboard and by touch.
17
- */
18
- function HoverCard$1(props) {
19
- return createComponent(HoverCard, props);
20
- }
21
- function HoverCardTrigger(props) {
22
- return createComponent(HoverCard.Trigger, props);
23
- }
24
7
  function HoverCardContent(props) {
25
8
  const [local, rest] = splitProps(props, ["class", "children"]);
26
9
  return createComponent(HoverCard.Portal, { get children() {
27
- return createComponent(HoverCard.Content, mergeProps({ get ["class"]() {
28
- return cn(overlaySurface, "z-(--z-menu) w-64 p-3", "origin-(--kb-hover-card-content-transform-origin)", "data-expanded:animate-in data-expanded:fade-in-0 data-expanded:zoom-in-95", "data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", "data-expanded:duration-150 data-closed:duration-100", local.class);
10
+ return createComponent(HoverCard.Content, mergeProps(topLayerProps, { get ["class"]() {
11
+ return cn(overlaySurface, "z-(--z-menu) w-64 p-3", "origin-(--kb-hover-card-content-transform-origin)", tooltipMotion, local.class);
29
12
  } }, rest, { get children() {
30
13
  return [memo(() => local.children), createComponent(HoverCard.Arrow, {
31
14
  "aria-hidden": "true",
@@ -1 +1 @@
1
- {"version":3,"file":"hover-card.js","names":["HoverCard","KobalteHoverCard","ComponentProps","splitProps","overlaySurface","popoverArrow","cn","props","_$createComponent","HoverCardTrigger","Trigger","HoverCardContent","Content","local","rest","Portal","children","_$mergeProps","class","_$memo","Arrow","HoverCard","_$createComponent","KobalteHoverCard","_$mergeProps","_$memo"],"sources":["../../../../src/components/ui/hover-card/hover-card.tsx"],"sourcesContent":["import { HoverCard as KobalteHoverCard } from '@kobalte/core/hover-card'\nimport type { ComponentProps } from 'solid-js'\nimport { splitProps } from 'solid-js'\nimport { overlaySurface, popoverArrow } from '#lib/overlay'\nimport { cn } from '#lib/utils'\n\n/**\n * HoverCard.\n *\n * A rich preview shown on hover: a user's profile, a file's summary, a link's\n * destination. The difference from Tooltip is that this may be hovered *into*\n * — the pointer can leave the trigger, cross the gap, and read the card.\n *\n * Because it only opens on hover, its content must also be reachable another\n * way (clicking the trigger, for instance). A hover card that holds the only\n * route to something is unreachable by keyboard and by touch.\n */\nexport function HoverCard(props: ComponentProps<typeof KobalteHoverCard>) {\n return <KobalteHoverCard {...props} />\n}\n\nexport function HoverCardTrigger(props: ComponentProps<typeof KobalteHoverCard.Trigger>) {\n return <KobalteHoverCard.Trigger {...props} />\n}\n\nexport function HoverCardContent(props: ComponentProps<typeof KobalteHoverCard.Content>) {\n const [local, rest] = splitProps(props, ['class', 'children'])\n\n return (\n <KobalteHoverCard.Portal>\n <KobalteHoverCard.Content\n class={cn(\n overlaySurface,\n 'z-(--z-menu) w-64 p-3',\n 'origin-(--kb-hover-card-content-transform-origin)',\n 'data-expanded:animate-in data-expanded:fade-in-0 data-expanded:zoom-in-95',\n 'data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95',\n 'data-expanded:duration-150 data-closed:duration-100',\n local.class\n )}\n {...rest}\n >\n {local.children}\n <KobalteHoverCard.Arrow aria-hidden=\"true\" class={popoverArrow} />\n </KobalteHoverCard.Content>\n </KobalteHoverCard.Portal>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAiBA,SAAgBA,YAAUO,OAAgD;CACxE,OAAAC,gBAAQP,WAAqBM,KAAK;AACpC;AAEA,SAAgBE,iBAAiBF,OAAwD;CACvF,OAAAC,gBAAQP,UAAiBS,SAAYH,KAAK;AAC5C;AAEA,SAAgBI,iBAAiBJ,OAAwD;CACvF,MAAM,CAACM,OAAOC,QAAQX,WAAWI,OAAO,CAAC,SAAS,UAAU,CAAC;CAE7D,OAAAC,gBACGP,UAAiBc,QAAM,EAAA,IAAAC,WAAA;EAAA,OAAAR,gBACrBP,UAAiBW,SAAOK,WAAA,EAAA,KAAA,WAAA;GAAA,OAChBX,GACLF,gBACA,yBACA,qDACA,6EACA,0EACA,uDACAS,MAAMK,KACR;EAAC,EAAA,GACGJ,MAAI,EAAA,IAAAE,WAAA;GAAA,OAAA,CAAAG,WAEPN,MAAMG,QAAQ,GAAAR,gBACdP,UAAiBmB,OAAK;IAAA,eAAA;IAAA,SAA2Bf;GAAY,CAAA,CAAA;EAAA,EAAA,CAAA,CAAA;CAAA,EAAA,CAAA;AAItE"}
1
+ {"version":3,"file":"hover-card.js","names":["HoverCard","KobalteHoverCard","ComponentProps","splitProps","overlaySurface","popoverArrow","tooltipMotion","topLayerProps","cn","Root","Trigger","HoverCardTrigger","HoverCardContent","props","Content","local","rest","_$createComponent","Portal","children","_$mergeProps","class","_$memo","Arrow","_$createComponent","KobalteHoverCard","_$mergeProps","_$memo"],"sources":["../../../../src/components/ui/hover-card/hover-card.tsx"],"sourcesContent":["import { HoverCard as KobalteHoverCard } from '@kobalte/core/hover-card'\nimport type { ComponentProps } from 'solid-js'\nimport { splitProps } from 'solid-js'\nimport { overlaySurface, popoverArrow, tooltipMotion, topLayerProps } from '#lib/overlay'\nimport { cn } from '#lib/utils'\n\n/**\n * HoverCard.\n *\n * A rich preview shown on hover: a user's profile, a file's summary, a link's\n * destination. The difference from Tooltip is that this may be hovered *into*\n * — the pointer can leave the trigger, cross the gap, and read the card.\n *\n * Because it only opens on hover, its content must also be reachable another\n * way (clicking the trigger, for instance). A hover card that holds the only\n * route to something is unreachable by keyboard and by touch.\n */\nexport { Root as HoverCard, Trigger as HoverCardTrigger } from '@kobalte/core/hover-card'\n\nexport function HoverCardContent(props: ComponentProps<typeof KobalteHoverCard.Content>) {\n const [local, rest] = splitProps(props, ['class', 'children'])\n\n return (\n <KobalteHoverCard.Portal>\n <KobalteHoverCard.Content\n {...topLayerProps}\n class={cn(\n overlaySurface,\n 'z-(--z-menu) w-64 p-3',\n 'origin-(--kb-hover-card-content-transform-origin)',\n tooltipMotion,\n local.class\n )}\n {...rest}\n >\n {local.children}\n <KobalteHoverCard.Arrow aria-hidden=\"true\" class={popoverArrow} />\n </KobalteHoverCard.Content>\n </KobalteHoverCard.Portal>\n )\n}\n"],"mappings":";;;;;;AAmBA,SAAgBY,iBAAiBC,OAAwD;CACvF,MAAM,CAACE,OAAOC,QAAQb,WAAWU,OAAO,CAAC,SAAS,UAAU,CAAC;CAE7D,OAAAI,gBACGhB,UAAiBiB,QAAM,EAAA,IAAAC,WAAA;EAAA,OAAAF,gBACrBhB,UAAiBa,SAAOM,WACnBb,eAAa,EAAA,KAAA,WAAA;GAAA,OACVC,GACLJ,gBACA,yBACA,qDACAE,eACAS,MAAMM,KACR;EAAC,EAAA,GACGL,MAAI,EAAA,IAAAG,WAAA;GAAA,OAAA,CAAAG,WAEPP,MAAMI,QAAQ,GAAAF,gBACdhB,UAAiBsB,OAAK;IAAA,eAAA;IAAA,SAA2BlB;GAAY,CAAA,CAAA;EAAA,EAAA,CAAA,CAAA;CAAA,EAAA,CAAA;AAItE"}