@adea-ai/ui 0.162.6 → 0.162.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (364) hide show
  1. package/dist/components/composites/about-dialog/about-dialog.js +5 -5
  2. package/dist/components/composites/about-dialog/about-dialog.js.map +1 -1
  3. package/dist/components/composites/accent-picker/accent-picker.js +3 -3
  4. package/dist/components/composites/accent-picker/accent-picker.js.map +1 -1
  5. package/dist/components/composites/accent-picker/custom-color-popover.js +2 -2
  6. package/dist/components/composites/accent-picker/custom-color-popover.js.map +1 -1
  7. package/dist/components/composites/account-menu/account-menu.js +22 -22
  8. package/dist/components/composites/account-menu/account-menu.js.map +1 -1
  9. package/dist/components/composites/action-button/action-button.js +2 -2
  10. package/dist/components/composites/action-button/action-button.js.map +1 -1
  11. package/dist/components/composites/appearance-editor/accent-swatch-groups.js +3 -3
  12. package/dist/components/composites/appearance-editor/accent-swatch-groups.js.map +1 -1
  13. package/dist/components/composites/appearance-editor/appearance-choices.js +10 -10
  14. package/dist/components/composites/appearance-editor/appearance-choices.js.map +1 -1
  15. package/dist/components/composites/appearance-editor/appearance-editor.js +13 -13
  16. package/dist/components/composites/appearance-editor/appearance-editor.js.map +1 -1
  17. package/dist/components/composites/appearance-editor/appearance-rows.js +12 -12
  18. package/dist/components/composites/appearance-editor/appearance-rows.js.map +1 -1
  19. package/dist/components/composites/appearance-editor/font-settings-group.js +13 -13
  20. package/dist/components/composites/appearance-editor/font-settings-group.js.map +1 -1
  21. package/dist/components/composites/appearance-editor/theme-preview.js +1 -1
  22. package/dist/components/composites/appearance-editor/theme-preview.js.map +1 -1
  23. package/dist/components/composites/catalog-browser/catalog-browser-group.js +9 -9
  24. package/dist/components/composites/catalog-browser/catalog-browser-group.js.map +1 -1
  25. package/dist/components/composites/catalog-browser/catalog-browser.js +10 -10
  26. package/dist/components/composites/catalog-browser/catalog-browser.js.map +1 -1
  27. package/dist/components/composites/catalog-browser/catalog-detail.js +1 -1
  28. package/dist/components/composites/catalog-browser/catalog-detail.js.map +1 -1
  29. package/dist/components/composites/chain-of-thought/chain-of-thought.js +5 -5
  30. package/dist/components/composites/chain-of-thought/chain-of-thought.js.map +1 -1
  31. package/dist/components/composites/chat/chat.js +7 -7
  32. package/dist/components/composites/chat/chat.js.map +1 -1
  33. package/dist/components/composites/checkpoint/checkpoint.js +5 -5
  34. package/dist/components/composites/checkpoint/checkpoint.js.map +1 -1
  35. package/dist/components/composites/confirmation/confirmation.js +13 -13
  36. package/dist/components/composites/confirmation/confirmation.js.map +1 -1
  37. package/dist/components/composites/context/context.js +7 -7
  38. package/dist/components/composites/context/context.js.map +1 -1
  39. package/dist/components/composites/file-tree/build-file-tree.js +1 -1
  40. package/dist/components/composites/file-tree/build-file-tree.js.map +1 -1
  41. package/dist/components/composites/file-tree/file-tree.js +9 -9
  42. package/dist/components/composites/file-tree/file-tree.js.map +1 -1
  43. package/dist/components/composites/help-center/help-center.js +5 -5
  44. package/dist/components/composites/help-center/help-center.js.map +1 -1
  45. package/dist/components/composites/icon-picker/icon-picker.js +10 -10
  46. package/dist/components/composites/icon-picker/icon-picker.js.map +1 -1
  47. package/dist/components/composites/icon-picker/image-data-url.js.map +1 -1
  48. package/dist/components/composites/icon-picker/shell-icons.js +117 -117
  49. package/dist/components/composites/icon-picker/shell-icons.js.map +1 -1
  50. package/dist/components/composites/inline-citation/inline-citation.js +7 -7
  51. package/dist/components/composites/inline-citation/inline-citation.js.map +1 -1
  52. package/dist/components/composites/list-row/list-row-control.js +1 -1
  53. package/dist/components/composites/list-row/list-row-control.js.map +1 -1
  54. package/dist/components/composites/list-row/list-row.js +2 -2
  55. package/dist/components/composites/list-row/list-row.js.map +1 -1
  56. package/dist/components/composites/message-scroller/message-scroller.js +7 -7
  57. package/dist/components/composites/message-scroller/message-scroller.js.map +1 -1
  58. package/dist/components/composites/message-scroller/scroll-anchor.js +1 -1
  59. package/dist/components/composites/message-scroller/scroll-anchor.js.map +1 -1
  60. package/dist/components/composites/model-selector/model-selector.js +12 -12
  61. package/dist/components/composites/model-selector/model-selector.js.map +1 -1
  62. package/dist/components/composites/plan/plan.js +5 -5
  63. package/dist/components/composites/plan/plan.js.map +1 -1
  64. package/dist/components/composites/prompt-input/prompt-input.js +3 -3
  65. package/dist/components/composites/prompt-input/prompt-input.js.map +1 -1
  66. package/dist/components/composites/queue/queue.js +13 -13
  67. package/dist/components/composites/queue/queue.js.map +1 -1
  68. package/dist/components/composites/reasoning/reasoning.js +5 -5
  69. package/dist/components/composites/reasoning/reasoning.js.map +1 -1
  70. package/dist/components/composites/scene-controls/scene-controls.js +16 -16
  71. package/dist/components/composites/scene-controls/scene-controls.js.map +1 -1
  72. package/dist/components/composites/settings/settings-layout.js +2 -2
  73. package/dist/components/composites/settings/settings-layout.js.map +1 -1
  74. package/dist/components/composites/settings/settings-navigation.js +2 -2
  75. package/dist/components/composites/settings/settings-navigation.js.map +1 -1
  76. package/dist/components/composites/settings/settings.js +5 -5
  77. package/dist/components/composites/settings/settings.js.map +1 -1
  78. package/dist/components/composites/sources/sources.js +5 -5
  79. package/dist/components/composites/sources/sources.js.map +1 -1
  80. package/dist/components/composites/stack-trace/parse-stack-trace.js +2 -2
  81. package/dist/components/composites/stack-trace/parse-stack-trace.js.map +1 -1
  82. package/dist/components/composites/stack-trace/stack-trace.js +10 -10
  83. package/dist/components/composites/stack-trace/stack-trace.js.map +1 -1
  84. package/dist/components/composites/stat/stat.js +6 -6
  85. package/dist/components/composites/stat/stat.js.map +1 -1
  86. package/dist/components/composites/subagent/subagent.js +5 -5
  87. package/dist/components/composites/subagent/subagent.js.map +1 -1
  88. package/dist/components/composites/suggestion/suggestion.js +2 -2
  89. package/dist/components/composites/suggestion/suggestion.js.map +1 -1
  90. package/dist/components/composites/task/task.js +5 -5
  91. package/dist/components/composites/task/task.js.map +1 -1
  92. package/dist/components/composites/terminal/ansi.js +1 -1
  93. package/dist/components/composites/terminal/ansi.js.map +1 -1
  94. package/dist/components/composites/terminal/terminal.js +18 -18
  95. package/dist/components/composites/terminal/terminal.js.map +1 -1
  96. package/dist/components/composites/test-results/test-results.js +17 -17
  97. package/dist/components/composites/test-results/test-results.js.map +1 -1
  98. package/dist/components/composites/tool/tool.js +5 -5
  99. package/dist/components/composites/tool/tool.js.map +1 -1
  100. package/dist/components/composites/tree/tree.js +6 -6
  101. package/dist/components/composites/tree/tree.js.map +1 -1
  102. package/dist/components/composites/update-dialog/channel-control.js +1 -1
  103. package/dist/components/composites/update-dialog/channel-control.js.map +1 -1
  104. package/dist/components/composites/update-dialog/update-dialog.js +23 -23
  105. package/dist/components/composites/update-dialog/update-dialog.js.map +1 -1
  106. package/dist/components/composites/workspace-mark/workspace-mark.js +2 -2
  107. package/dist/components/composites/workspace-mark/workspace-mark.js.map +1 -1
  108. package/dist/components/composites/workspace-switcher/workspace-reorder-dialog.js +6 -6
  109. package/dist/components/composites/workspace-switcher/workspace-reorder-dialog.js.map +1 -1
  110. package/dist/components/composites/workspace-switcher/workspace-switcher.js +11 -11
  111. package/dist/components/composites/workspace-switcher/workspace-switcher.js.map +1 -1
  112. package/dist/components/conversation/atomic/chat-composer.js +1 -1
  113. package/dist/components/conversation/busy-send-button.js +10 -10
  114. package/dist/components/conversation/busy-send-button.js.map +1 -1
  115. package/dist/components/conversation/chat-composer.js +1 -1
  116. package/dist/components/conversation/composer-core.js +1 -1
  117. package/dist/components/conversation/composer-menu.js +2 -2
  118. package/dist/components/conversation/composer-menu.js.map +1 -1
  119. package/dist/components/conversation/conversation-avatar.js +7 -7
  120. package/dist/components/conversation/conversation-avatar.js.map +1 -1
  121. package/dist/components/conversation/conversation-pane.js +1 -1
  122. package/dist/components/conversation/conversation-pane.js.map +1 -1
  123. package/dist/components/conversation/conversation-surface.js +5 -5
  124. package/dist/components/conversation/conversation-surface.js.map +1 -1
  125. package/dist/components/conversation/internal/chat-composer-shell.js +9 -9
  126. package/dist/components/conversation/internal/chat-composer-shell.js.map +1 -1
  127. package/dist/components/conversation/message-composer.js +9 -9
  128. package/dist/components/conversation/message-composer.js.map +1 -1
  129. package/dist/components/conversation/message-row.js +13 -13
  130. package/dist/components/conversation/message-row.js.map +1 -1
  131. package/dist/components/conversation/paste-token-editor.js +1 -1
  132. package/dist/components/conversation/paste-token-editor.js.map +1 -1
  133. package/dist/components/conversation/scroll-follow.js +1 -1
  134. package/dist/components/conversation/thread-panel.js +5 -5
  135. package/dist/components/conversation/thread-panel.js.map +1 -1
  136. package/dist/components/conversation/transcript-composition.js +5 -5
  137. package/dist/components/conversation/transcript-composition.js.map +1 -1
  138. package/dist/components/layout/app-shell/app-shell.js +1 -1
  139. package/dist/components/layout/app-shell/app-shell.js.map +1 -1
  140. package/dist/components/layout/app-shell/skip-link.js +1 -1
  141. package/dist/components/layout/app-shell/skip-link.js.map +1 -1
  142. package/dist/components/layout/contextual-sidebar/contextual-sidebar.js +2 -2
  143. package/dist/components/layout/contextual-sidebar/contextual-sidebar.js.map +1 -1
  144. package/dist/components/layout/contextual-sidebar/mobile-contextual-sidebar.js +1 -1
  145. package/dist/components/layout/floating-preview/floating-preview.js +7 -7
  146. package/dist/components/layout/floating-preview/floating-preview.js.map +1 -1
  147. package/dist/components/layout/orbit-layout/orbit-layout.js +1 -1
  148. package/dist/components/layout/orbit-layout/orbit-layout.js.map +1 -1
  149. package/dist/components/layout/page/page.js +2 -2
  150. package/dist/components/layout/page/page.js.map +1 -1
  151. package/dist/components/layout/panel/panel.js +1 -1
  152. package/dist/components/layout/panel/panel.js.map +1 -1
  153. package/dist/components/layout/pixel-pane/pixel-pane.js +1 -1
  154. package/dist/components/layout/pixel-resize-handle/pixel-resize-handle.js +5 -5
  155. package/dist/components/layout/pixel-resize-handle/pixel-resize-handle.js.map +1 -1
  156. package/dist/components/layout/shell-rail/shell-rail.js +5 -5
  157. package/dist/components/layout/shell-rail/shell-rail.js.map +1 -1
  158. package/dist/components/layout/shell-top-bar/shell-top-bar.js +2 -2
  159. package/dist/components/layout/shell-top-bar/shell-top-bar.js.map +1 -1
  160. package/dist/components/layout/side-rail/side-rail.js +2 -2
  161. package/dist/components/layout/side-rail/side-rail.js.map +1 -1
  162. package/dist/components/layout/sidebar-nav/sidebar-nav-resize-handle.js +1 -1
  163. package/dist/components/layout/sidebar-nav/sidebar-nav.js +5 -5
  164. package/dist/components/layout/sidebar-nav/sidebar-nav.js.map +1 -1
  165. package/dist/components/layout/split-layout/pane-focus.js.map +1 -1
  166. package/dist/components/layout/split-layout/resize-controller-core-retry.js +1 -1
  167. package/dist/components/layout/split-layout/resize-controller-core-retry.js.map +1 -1
  168. package/dist/components/layout/split-layout/resize-controller-core.js +1 -1
  169. package/dist/components/layout/split-layout/resize-controller-core.js.map +1 -1
  170. package/dist/components/layout/split-layout/split-layout.js +7 -7
  171. package/dist/components/layout/split-layout/split-layout.js.map +1 -1
  172. package/dist/components/layout/status-bar/status-bar.js +1 -1
  173. package/dist/components/layout/status-bar/status-bar.js.map +1 -1
  174. package/dist/components/layout/top-bar/top-bar.js +5 -5
  175. package/dist/components/layout/top-bar/top-bar.js.map +1 -1
  176. package/dist/components/layout/virtual-window/virtual-window.js +1 -1
  177. package/dist/components/layout/virtual-window/virtual-window.js.map +1 -1
  178. package/dist/components/motion/presence.js +1 -1
  179. package/dist/components/theme/appearance-panel.js +3 -3
  180. package/dist/components/theme/appearance-panel.js.map +1 -1
  181. package/dist/components/theme/lazy.js +3 -3
  182. package/dist/components/theme/lazy.js.map +1 -1
  183. package/dist/components/theme/script-projection.js +1 -1
  184. package/dist/components/theme/theme-catalogue-source.js +1 -1
  185. package/dist/components/theme/theme-document.js.map +1 -1
  186. package/dist/components/theme/theme-mode-toggle.js +7 -7
  187. package/dist/components/theme/theme-mode-toggle.js.map +1 -1
  188. package/dist/components/theme/theme-picker.js +2 -2
  189. package/dist/components/theme/theme-picker.js.map +1 -1
  190. package/dist/components/theme/theme-provider-value.js +1 -1
  191. package/dist/components/theme/theme-provider-value.js.map +1 -1
  192. package/dist/components/theme/theme-provider.js +1 -1
  193. package/dist/components/theme/theme-toggle.js +7 -7
  194. package/dist/components/theme/theme-toggle.js.map +1 -1
  195. package/dist/components/ui/accordion/accordion.js +13 -13
  196. package/dist/components/ui/accordion/accordion.js.map +1 -1
  197. package/dist/components/ui/alert/alert.js +12 -12
  198. package/dist/components/ui/alert/alert.js.map +1 -1
  199. package/dist/components/ui/alert-dialog/alert-dialog.js +14 -14
  200. package/dist/components/ui/alert-dialog/alert-dialog.js.map +1 -1
  201. package/dist/components/ui/annotation-surface/annotation-surface.js +2 -2
  202. package/dist/components/ui/annotation-surface/annotation-surface.js.map +1 -1
  203. package/dist/components/ui/aspect-ratio/aspect-ratio.js +1 -1
  204. package/dist/components/ui/aspect-ratio/aspect-ratio.js.map +1 -1
  205. package/dist/components/ui/attachment/attachment.js +16 -16
  206. package/dist/components/ui/attachment/attachment.js.map +1 -1
  207. package/dist/components/ui/avatar/avatar.js +1 -1
  208. package/dist/components/ui/avatar/avatar.js.map +1 -1
  209. package/dist/components/ui/badge/badge.js +2 -2
  210. package/dist/components/ui/badge/badge.js.map +1 -1
  211. package/dist/components/ui/board/board.js +2 -2
  212. package/dist/components/ui/board/board.js.map +1 -1
  213. package/dist/components/ui/breadcrumb/breadcrumb.js +7 -7
  214. package/dist/components/ui/breadcrumb/breadcrumb.js.map +1 -1
  215. package/dist/components/ui/bubble/bubble.js +2 -2
  216. package/dist/components/ui/bubble/bubble.js.map +1 -1
  217. package/dist/components/ui/button/button.js +2 -2
  218. package/dist/components/ui/button-group/button-group.js +2 -2
  219. package/dist/components/ui/button-group/button-group.js.map +1 -1
  220. package/dist/components/ui/calendar/calendar.js +8 -8
  221. package/dist/components/ui/calendar/calendar.js.map +1 -1
  222. package/dist/components/ui/callout/callout.js +2 -2
  223. package/dist/components/ui/callout/callout.js.map +1 -1
  224. package/dist/components/ui/card/card.js +2 -2
  225. package/dist/components/ui/card/card.js.map +1 -1
  226. package/dist/components/ui/carousel/carousel.js +8 -8
  227. package/dist/components/ui/carousel/carousel.js.map +1 -1
  228. package/dist/components/ui/chart/chart.js +2 -2
  229. package/dist/components/ui/chart/chart.js.map +1 -1
  230. package/dist/components/ui/checkbox/checkbox.js +6 -6
  231. package/dist/components/ui/checkbox/checkbox.js.map +1 -1
  232. package/dist/components/ui/code-block/code-block.js +6 -6
  233. package/dist/components/ui/code-block/code-block.js.map +1 -1
  234. package/dist/components/ui/collapsible/collapsible.js +7 -7
  235. package/dist/components/ui/collapsible/collapsible.js.map +1 -1
  236. package/dist/components/ui/combobox/combobox.js +21 -21
  237. package/dist/components/ui/combobox/combobox.js.map +1 -1
  238. package/dist/components/ui/combobox/value-combobox.js +1 -1
  239. package/dist/components/ui/command/command.js +23 -23
  240. package/dist/components/ui/command/command.js.map +1 -1
  241. package/dist/components/ui/context-menu/context-menu.js +2 -2
  242. package/dist/components/ui/detail-panel/detail-panel.js +5 -5
  243. package/dist/components/ui/detail-panel/detail-panel.js.map +1 -1
  244. package/dist/components/ui/dialog/dialog-layer.js +2 -2
  245. package/dist/components/ui/dialog/dialog-layer.js.map +1 -1
  246. package/dist/components/ui/dialog/dialog.js +21 -21
  247. package/dist/components/ui/dialog/dialog.js.map +1 -1
  248. package/dist/components/ui/diff-block/diff-block.js +2 -2
  249. package/dist/components/ui/diff-block/diff-block.js.map +1 -1
  250. package/dist/components/ui/drawer/drawer.js +14 -14
  251. package/dist/components/ui/drawer/drawer.js.map +1 -1
  252. package/dist/components/ui/dropdown-menu/dropdown-menu.js +3 -3
  253. package/dist/components/ui/dropdown-menu/menu-parts.js +10 -10
  254. package/dist/components/ui/dropdown-menu/menu-parts.js.map +1 -1
  255. package/dist/components/ui/empty/empty-state.js +5 -5
  256. package/dist/components/ui/empty/empty-state.js.map +1 -1
  257. package/dist/components/ui/empty/empty.js +1 -1
  258. package/dist/components/ui/empty/empty.js.map +1 -1
  259. package/dist/components/ui/entity-icon/entity-icon.js +2 -2
  260. package/dist/components/ui/entity-icon/entity-icon.js.map +1 -1
  261. package/dist/components/ui/field/field.js +14 -14
  262. package/dist/components/ui/field/field.js.map +1 -1
  263. package/dist/components/ui/field/number-field.js +2 -2
  264. package/dist/components/ui/field/number-field.js.map +1 -1
  265. package/dist/components/ui/hover-card/hover-card.js +10 -10
  266. package/dist/components/ui/hover-card/hover-card.js.map +1 -1
  267. package/dist/components/ui/input/input-control.js +1 -1
  268. package/dist/components/ui/input/input-control.js.map +1 -1
  269. package/dist/components/ui/input/input.js +2 -2
  270. package/dist/components/ui/input/input.js.map +1 -1
  271. package/dist/components/ui/input-group/input-group.js +2 -2
  272. package/dist/components/ui/input-group/input-group.js.map +1 -1
  273. package/dist/components/ui/input-group/secret-input-group.js +2 -2
  274. package/dist/components/ui/input-otp/input-otp.js +2 -2
  275. package/dist/components/ui/input-otp/input-otp.js.map +1 -1
  276. package/dist/components/ui/item/item.js +2 -2
  277. package/dist/components/ui/item/item.js.map +1 -1
  278. package/dist/components/ui/kbd/kbd.js +2 -2
  279. package/dist/components/ui/kbd/kbd.js.map +1 -1
  280. package/dist/components/ui/label/label.js +1 -1
  281. package/dist/components/ui/label/label.js.map +1 -1
  282. package/dist/components/ui/marker/marker.js +2 -2
  283. package/dist/components/ui/marker/marker.js.map +1 -1
  284. package/dist/components/ui/menubar/menubar.js +7 -7
  285. package/dist/components/ui/menubar/menubar.js.map +1 -1
  286. package/dist/components/ui/message/message.js +3 -3
  287. package/dist/components/ui/message/message.js.map +1 -1
  288. package/dist/components/ui/modal-dialog/modal-dialog.js +2 -2
  289. package/dist/components/ui/modal-dialog/modal-dialog.js.map +1 -1
  290. package/dist/components/ui/native-select/native-select.js +5 -5
  291. package/dist/components/ui/native-select/native-select.js.map +1 -1
  292. package/dist/components/ui/navigation-menu/navigation-menu.js +18 -18
  293. package/dist/components/ui/navigation-menu/navigation-menu.js.map +1 -1
  294. package/dist/components/ui/pagination/pagination.js +28 -28
  295. package/dist/components/ui/pagination/pagination.js.map +1 -1
  296. package/dist/components/ui/popover/popover.js +15 -15
  297. package/dist/components/ui/popover/popover.js.map +1 -1
  298. package/dist/components/ui/progress/progress.js +5 -5
  299. package/dist/components/ui/progress/progress.js.map +1 -1
  300. package/dist/components/ui/questionnaire/questionnaire.js +10 -10
  301. package/dist/components/ui/questionnaire/questionnaire.js.map +1 -1
  302. package/dist/components/ui/radio-group/radio-group.js +9 -9
  303. package/dist/components/ui/radio-group/radio-group.js.map +1 -1
  304. package/dist/components/ui/resizable/resizable.js +11 -11
  305. package/dist/components/ui/resizable/resizable.js.map +1 -1
  306. package/dist/components/ui/scroll-area/scroll-area.js +1 -1
  307. package/dist/components/ui/scroll-area/scroll-area.js.map +1 -1
  308. package/dist/components/ui/select/select.js +21 -21
  309. package/dist/components/ui/select/select.js.map +1 -1
  310. package/dist/components/ui/separator/separator.js +5 -5
  311. package/dist/components/ui/separator/separator.js.map +1 -1
  312. package/dist/components/ui/sheet/sheet.js +6 -6
  313. package/dist/components/ui/sheet/sheet.js.map +1 -1
  314. package/dist/components/ui/skeleton/skeleton.js +1 -1
  315. package/dist/components/ui/skeleton/skeleton.js.map +1 -1
  316. package/dist/components/ui/slider/slider.js +5 -5
  317. package/dist/components/ui/slider/slider.js.map +1 -1
  318. package/dist/components/ui/spinner/spinner.js +5 -5
  319. package/dist/components/ui/spinner/spinner.js.map +1 -1
  320. package/dist/components/ui/status-chip/status-chip.js +2 -2
  321. package/dist/components/ui/status-chip/status-chip.js.map +1 -1
  322. package/dist/components/ui/switch/switch.js +4 -4
  323. package/dist/components/ui/switch/switch.js.map +1 -1
  324. package/dist/components/ui/table/table.js +1 -1
  325. package/dist/components/ui/table/table.js.map +1 -1
  326. package/dist/components/ui/tabs/tabs.js +7 -7
  327. package/dist/components/ui/tabs/tabs.js.map +1 -1
  328. package/dist/components/ui/text-link/text-link.js +1 -1
  329. package/dist/components/ui/text-link/text-link.js.map +1 -1
  330. package/dist/components/ui/textarea/textarea.js +2 -2
  331. package/dist/components/ui/textarea/textarea.js.map +1 -1
  332. package/dist/components/ui/toast/toast.js +7 -7
  333. package/dist/components/ui/toast/toast.js.map +1 -1
  334. package/dist/components/ui/toggle/toggle.js +6 -6
  335. package/dist/components/ui/toggle/toggle.js.map +1 -1
  336. package/dist/components/ui/toggle-group/toggle-group.js +7 -8
  337. package/dist/components/ui/toggle-group/toggle-group.js.map +1 -1
  338. package/dist/components/ui/tooltip/deferred-tooltip.js +6 -6
  339. package/dist/components/ui/tooltip/deferred-tooltip.js.map +1 -1
  340. package/dist/components/ui/tooltip/lazy-tooltip.js +2 -2
  341. package/dist/components/ui/tooltip/tooltip.js +10 -10
  342. package/dist/components/ui/tooltip/tooltip.js.map +1 -1
  343. package/dist/components/ui/trace/trace.js +19 -19
  344. package/dist/components/ui/trace/trace.js.map +1 -1
  345. package/dist/components/ui/typography/typography.js +2 -2
  346. package/dist/lib/accent-presets.js +1 -1
  347. package/dist/lib/accent-roles.js +2 -2
  348. package/dist/lib/async-action.js +1 -1
  349. package/dist/lib/create-poll.js +1 -1
  350. package/dist/lib/create-poll.js.map +1 -1
  351. package/dist/lib/external-link.js +1 -1
  352. package/dist/lib/external-link.js.map +1 -1
  353. package/dist/lib/fast-icon.js +1 -1
  354. package/dist/lib/theme-css.js +1 -1
  355. package/dist/lib/theme-engine-light.js +1 -1
  356. package/dist/lib/theme-projection.js +2 -2
  357. package/dist/lib/theme-records.js +1 -1
  358. package/dist/lib/themes.js +1 -1
  359. package/dist/lib/themes.js.map +1 -1
  360. package/dist/lib/tooltip-focus-gate.js.map +1 -1
  361. package/dist/lib/utils.js +1 -1
  362. package/dist/vite/source-parser.js +1 -1
  363. package/dist/vite/tailwind-sources.js +1 -1
  364. package/package.json +7 -7
@@ -1,18 +1,18 @@
1
+ import { Portal, createComponent, memo, mergeProps, spread, template } from "@solidjs/web";
2
+ import { AlertDialog as AlertDialog$1, AlertDialogBackdrop, AlertDialogClose, AlertDialogContent as AlertDialogContent$1, AlertDialogDescription as AlertDialogDescription$1, AlertDialogTitle as AlertDialogTitle$1, AlertDialogTrigger as AlertDialogTrigger$1, createAlertDialogController } from "@ui-sdk/solid/alert-dialog";
3
+ import { omit } from "solid-js";
1
4
  import { dialogSurface, overlayDescription, overlayFooter, overlayHeader, overlayMotion, overlayPositioner, overlayScrim, overlayScrimMotion, overlayTitle } from "../../../lib/overlay.js";
2
5
  import { cn } from "../../../lib/utils.js";
3
6
  import { asRender, expandedDiv, overlayContainer, triggerRender } from "../tooltip/tooltip.js";
4
7
  import { DialogScrim, LayerEscapeTarget, LayerRootContext, TopLayerPositioner, createLayerRoot, layerHandlerProps, layerHandlers, useLayerContent } from "../dialog/dialog-layer.js";
5
8
  import { forwardRef } from "../../../lib/refs.js";
6
- import { Portal, createComponent, memo, mergeProps, spread, template } from "@solidjs/web";
7
- import { omit } from "solid-js";
8
- import { AlertDialog, AlertDialogBackdrop, AlertDialogClose, AlertDialogContent, AlertDialogDescription, AlertDialogTitle, AlertDialogTrigger, createAlertDialogController } from "@ui-sdk/solid/alert-dialog";
9
9
  // src/components/ui/alert-dialog/alert-dialog.tsx
10
10
  var _tmpl$ = /* @__PURE__ */ template(`<div>`);
11
- function AlertDialog$1(props) {
11
+ function AlertDialog(props) {
12
12
  const controller = createAlertDialogController();
13
13
  const layer = createLayerRoot(() => controller.close({ reason: "escape-key" }));
14
14
  const rest = omit(props, "children", "onOpenChange", "preventScroll", "forceMount", "id", "translations", "modal");
15
- return createComponent(AlertDialog, mergeProps(rest, {
15
+ return createComponent(AlertDialog$1, mergeProps(rest, {
16
16
  controller,
17
17
  onOpenChange: (open, details) => {
18
18
  if (layer.refuses(open, details)) return details.cancel();
@@ -28,8 +28,8 @@ function AlertDialog$1(props) {
28
28
  }
29
29
  }));
30
30
  }
31
- function AlertDialogTrigger$1(props) {
32
- return createComponent(AlertDialogTrigger, mergeProps(() => {
31
+ function AlertDialogTrigger(props) {
32
+ return createComponent(AlertDialogTrigger$1, mergeProps(() => {
33
33
  return omit(props, "as");
34
34
  }, { get render() {
35
35
  return triggerRender(props.as, "button", () => props["data-slot"]);
@@ -62,7 +62,7 @@ function AlertDialogOverlay(props) {
62
62
  * A press on the scrim lands on that positioner, outside the panel, and ui-sdk's
63
63
  * alert dialog never closes on it.
64
64
  */
65
- function AlertDialogContent$1(props) {
65
+ function AlertDialogContent(props) {
66
66
  let panel;
67
67
  const rest = omit(props, "class", "children", "ref", "restoreFocusRef", ...layerHandlerProps);
68
68
  const focus = useLayerContent({
@@ -75,7 +75,7 @@ function AlertDialogContent$1(props) {
75
75
  return overlayContainer();
76
76
  },
77
77
  get children() {
78
- return createComponent(AlertDialogContent, mergeProps({
78
+ return createComponent(AlertDialogContent$1, mergeProps({
79
79
  inline: true,
80
80
  ref: (element) => {
81
81
  panel = element;
@@ -135,8 +135,8 @@ function AlertDialogFooter(props) {
135
135
  }, rest], false);
136
136
  return _el$2;
137
137
  }
138
- function AlertDialogTitle$1(props) {
139
- return createComponent(AlertDialogTitle, mergeProps({
138
+ function AlertDialogTitle(props) {
139
+ return createComponent(AlertDialogTitle$1, mergeProps({
140
140
  get "class"() {
141
141
  return cn(overlayTitle, props.class);
142
142
  },
@@ -147,8 +147,8 @@ function AlertDialogTitle$1(props) {
147
147
  return omit(props, "class", "as");
148
148
  }));
149
149
  }
150
- function AlertDialogDescription$1(props) {
151
- return createComponent(AlertDialogDescription, mergeProps({
150
+ function AlertDialogDescription(props) {
151
+ return createComponent(AlertDialogDescription$1, mergeProps({
152
152
  get "class"() {
153
153
  return cn(overlayDescription, props.class);
154
154
  },
@@ -190,6 +190,6 @@ function AlertDialogAction(props) {
190
190
  function AlertDialogCancel(props) {
191
191
  return createComponent(AlertDialogChoice, props);
192
192
  }
193
- export { AlertDialog$1 as AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent$1 as AlertDialogContent, AlertDialogDescription$1 as AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle$1 as AlertDialogTitle, AlertDialogTrigger$1 as AlertDialogTrigger };
193
+ export { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger };
194
194
 
195
195
  //# sourceMappingURL=alert-dialog.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"alert-dialog.js","names":["<UiAlertDialog\n {...(rest as AlertDialogOptions)}\n controller={controller}\n onOpenChange={(open, details) => {\n if (layer.refuses(open, details)) return details.cancel()\n props.onOpenChange?.(open, details)\n }}\n >\n <LayerRootContext value={layer}>{props.children}</LayerRootContext>\n </UiAlertDialog>","onOpenChange={(open, details) => {\n if (layer.refuses(open, details)) return details.cancel()\n props.onOpenChange?.(open, details)\n }}","<LayerRootContext value={layer}>{props.children}</LayerRootContext>","value={layer}","<UiAlertDialogTrigger\n {...omit(props, 'as')}\n render={triggerRender(props.as, 'button', () => props['data-slot'])}\n />","<Portal mount={props.mount ?? overlayContainer()}>{props.children}</Portal>","<UiAlertDialogBackdrop\n class={cn(overlayScrim, overlayScrimMotion, props.class)}\n render={expandedDiv}\n {...omit(props, 'class')}\n />","render={expandedDiv}","<Portal mount={overlayContainer()}>\n <UiAlertDialogContent\n inline\n ref={(element: HTMLDivElement) => {\n panel = element\n forwardRef(() => props.ref, element)\n }}\n initialFocus={props.onOpenAutoFocus ? focus.initialFocus() : undefined}\n finalFocus={focus.finalFocus()}\n class={cn(\n dialogSurface,\n overlayMotion,\n // Positioned, so it paints above the fixed scrim beside it (a static\n // box paints under a positioned sibling whatever their order).\n 'relative grid max-h-full w-full max-w-md gap-4 overflow-y-auto p-5',\n props.class\n )}\n render={(panelProps, state) => (\n <TopLayerPositioner class={overlayPositioner}>\n <DialogScrim open={state.open} />\n {expandedDiv(panelProps, state)}\n </TopLayerPositioner>\n )}\n {...rest}\n >\n <LayerEscapeTarget element={() => panel}>{props.children}</LayerEscapeTarget>\n </UiAlertDialogContent>\n </Portal>","<UiAlertDialogContent\n inline\n ref={(element: HTMLDivElement) => {\n panel = element\n forwardRef(() => props.ref, element)\n }}\n initialFocus={props.onOpenAutoFocus ? focus.initialFocus() : undefined}\n finalFocus={focus.finalFocus()}\n class={cn(\n dialogSurface,\n overlayMotion,\n // Positioned, so it paints above the fixed scrim beside it (a static\n // box paints under a positioned sibling whatever their order).\n 'relative grid max-h-full w-full max-w-md gap-4 overflow-y-auto p-5',\n props.class\n )}\n render={(panelProps, state) => (\n <TopLayerPositioner class={overlayPositioner}>\n <DialogScrim open={state.open} />\n {expandedDiv(panelProps, state)}\n </TopLayerPositioner>\n )}\n {...rest}\n >\n <LayerEscapeTarget element={() => panel}>{props.children}</LayerEscapeTarget>\n </UiAlertDialogContent>","ref={(element: HTMLDivElement) => {\n panel = element\n forwardRef(() => props.ref, element)\n }}","props.onOpenAutoFocus ? focus.initialFocus() : undefined","render={(panelProps, state) => (\n <TopLayerPositioner class={overlayPositioner}>\n <DialogScrim open={state.open} />\n {expandedDiv(panelProps, state)}\n </TopLayerPositioner>\n )}","<TopLayerPositioner class={overlayPositioner}>\n <DialogScrim open={state.open} />\n {expandedDiv(panelProps, state)}\n </TopLayerPositioner>","class={overlayPositioner}","<DialogScrim open={state.open} />","expandedDiv(panelProps, state)","<LayerEscapeTarget element={() => panel}>{props.children}</LayerEscapeTarget>","element={() => panel}","<div data-slot=\"alert-dialog-header\" class={cn(overlayHeader, props.class)} {...rest} />","<div data-slot=\"alert-dialog-footer\" class={cn(overlayFooter, props.class)} {...rest} />","<UiAlertDialogTitle\n class={cn(overlayTitle, props.class)}\n render={asRender(props.as, () => props['data-slot'])}\n {...omit(props, 'class', 'as')}\n />","<UiAlertDialogDescription\n class={cn(overlayDescription, props.class)}\n render={asRender(props.as, () => props['data-slot'])}\n {...omit(props, 'class', 'as')}\n />","<UiAlertDialogClose\n class={cn(props.class)}\n render={asRender(props.as, () => props['data-slot'])}\n {...omit(props, 'class', 'as')}\n />","<AlertDialogChoice {...props} />","AlertDialog","AlertDialogTrigger","AlertDialogContent","AlertDialogTitle","AlertDialogDescription"],"sources":["../../../../src/components/ui/alert-dialog/alert-dialog.tsx"],"sourcesContent":["import {\n AlertDialog as UiAlertDialog,\n AlertDialogBackdrop as UiAlertDialogBackdrop,\n AlertDialogClose as UiAlertDialogClose,\n AlertDialogContent as UiAlertDialogContent,\n AlertDialogDescription as UiAlertDialogDescription,\n AlertDialogTitle as UiAlertDialogTitle,\n AlertDialogTrigger as UiAlertDialogTrigger,\n createAlertDialogController,\n type AlertDialogOptions,\n} from '@ui-sdk/solid/alert-dialog'\nimport type { DialogOpenChangeDetails } from '@ui-sdk/solid/dialog'\nimport type { PartProps } from '@ui-sdk/solid/primitive'\nimport type { Accessor } from 'solid-js'\nimport type { ComponentProps, JSX, ValidComponent } from '@solidjs/web'\nimport { omit } from 'solid-js'\nimport { Portal } from '@solidjs/web'\nimport {\n dialogSurface,\n overlayDescription,\n overlayFooter,\n overlayHeader,\n overlayMotion,\n overlayPositioner,\n overlayScrim,\n overlayScrimMotion,\n overlayTitle,\n} from '#lib/overlay'\nimport { cn } from '#lib/utils'\nimport {\n asRender,\n triggerRender,\n expandedDiv,\n overlayContainer,\n type WithAs,\n} from '../tooltip/tooltip'\nimport {\n createLayerRoot,\n LayerEscapeTarget,\n type LayerHandlers,\n layerHandlerProps,\n layerHandlers,\n LayerRootContext,\n DialogScrim,\n TopLayerPositioner,\n useLayerContent,\n} from '../dialog/dialog-layer'\nimport { forwardRef } from '#lib/refs'\n\n/**\n * AlertDialog.\n *\n * A dialog that cannot be dismissed by accident: a click on the scrim does nothing,\n * and the user must choose one of the actions. Escape is the keyboard's Cancel: it\n * closes the dialog exactly as the cancel action does, so nothing is confirmed. That\n * is the whole difference from Dialog, and it is why this exists as its own\n * component rather than a prop, a caller has to reach for it deliberately.\n *\n * The consequence is a rule of use: this is for confirming a destructive or\n * irreversible step. Wrapping an ordinary form in an AlertDialog traps someone who\n * wants to back out.\n *\n * There is deliberately no close button in the corner. An X has no label, and the\n * point of this surface is that every exit is a named choice.\n *\n * ui-sdk's alert dialog is that surface already: always modal, never closed by a\n * press outside, `role=\"alertdialog\"`, its first Close part focused on open.\n * Escape is left to it. It can only ever cancel, never confirm, so it is not an\n * accident that matters; refusing it traps a keyboard user who has changed their\n * mind, and the WAI-ARIA alertdialog pattern says Escape closes. It reports\n * `onOpenChange(false)` and returns focus to the trigger, or to what had focus\n * before the confirmation opened, which is what the cancel action does; as the\n * topmost layer it closes only the confirmation, not a dialog underneath.\n */\nexport type AlertDialogProps = Omit<AlertDialogOptions, 'onOpenChange' | 'controller'> & {\n children?: JSX.Element\n /** The dialog wants to open or close. The second argument is ui-sdk's change details. */\n onOpenChange?: (open: boolean, details: DialogOpenChangeDetails) => void\n /** Kept for the API: an alert dialog always locks the page's scroll. */\n preventScroll?: boolean\n /** Kept for the API. */\n forceMount?: boolean\n}\n\nexport function AlertDialog(props: AlertDialogProps) {\n const controller = createAlertDialogController()\n const layer = createLayerRoot(() => controller.close({ reason: 'escape-key' }))\n const rest = omit(\n props as AlertDialogProps & Record<string, unknown>,\n 'children',\n 'onOpenChange',\n 'preventScroll',\n 'forceMount',\n 'id',\n 'translations',\n 'modal'\n )\n return (\n <UiAlertDialog\n {...(rest as AlertDialogOptions)}\n controller={controller}\n onOpenChange={(open, details) => {\n if (layer.refuses(open, details)) return details.cancel()\n props.onOpenChange?.(open, details)\n }}\n >\n <LayerRootContext value={layer}>{props.children}</LayerRootContext>\n </UiAlertDialog>\n )\n}\n\ntype PolymorphicPartProps<Tag extends keyof JSX.IntrinsicElements> = PartProps<Tag> & {\n /** Render the part as this component, which must forward props and ref to its element. */\n as?: ValidComponent\n class?: string\n [key: string]: unknown\n}\n\nexport function AlertDialogTrigger(props: WithAs<ComponentProps<typeof UiAlertDialogTrigger>>) {\n return (\n <UiAlertDialogTrigger\n {...omit(props, 'as')}\n render={triggerRender(props.as, 'button', () => props['data-slot'])}\n />\n )\n}\n\n/** Renders its children into `<body>`. The content already does; kept for the API. */\nexport function AlertDialogPortal(props: { children?: JSX.Element; mount?: Element }) {\n return <Portal mount={props.mount ?? overlayContainer()}>{props.children}</Portal>\n}\n\n/** The scrim as a part of its own. `AlertDialogContent` already draws one. */\nexport function AlertDialogOverlay(props: PartProps<'div'> & { class?: string }) {\n return (\n <UiAlertDialogBackdrop\n class={cn(overlayScrim, overlayScrimMotion, props.class)}\n render={expandedDiv}\n {...omit(props, 'class')}\n />\n )\n}\n\nexport type AlertDialogContentProps = Omit<\n ComponentProps<typeof UiAlertDialogContent>,\n 'class' | 'children' | 'ref' | 'render' | 'keepMounted' | 'inline' | keyof LayerHandlers\n> &\n LayerHandlers & {\n class?: string\n children?: JSX.Element\n ref?: ((element: HTMLDivElement) => void) | HTMLDivElement\n /** The control to focus on close when the one focused before opening is gone by then. */\n restoreFocusRef?: Accessor<HTMLElement | undefined>\n }\n\n/**\n * The panel, in a top-layer positioner like Dialog's (see `TopLayerPositioner`).\n * A press on the scrim lands on that positioner, outside the panel, and ui-sdk's\n * alert dialog never closes on it.\n */\nexport function AlertDialogContent(props: AlertDialogContentProps) {\n let panel: HTMLDivElement | undefined\n const rest = omit(props, 'class', 'children', 'ref', 'restoreFocusRef', ...layerHandlerProps)\n const focus = useLayerContent({\n content: () => panel,\n handlers: layerHandlers(props),\n restoreFocusRef: () => props.restoreFocusRef?.(),\n })\n\n return (\n <Portal mount={overlayContainer()}>\n <UiAlertDialogContent\n inline\n ref={(element: HTMLDivElement) => {\n panel = element\n forwardRef(() => props.ref, element)\n }}\n initialFocus={props.onOpenAutoFocus ? focus.initialFocus() : undefined}\n finalFocus={focus.finalFocus()}\n class={cn(\n dialogSurface,\n overlayMotion,\n // Positioned, so it paints above the fixed scrim beside it (a static\n // box paints under a positioned sibling whatever their order).\n 'relative grid max-h-full w-full max-w-md gap-4 overflow-y-auto p-5',\n props.class\n )}\n render={(panelProps, state) => (\n <TopLayerPositioner class={overlayPositioner}>\n <DialogScrim open={state.open} />\n {expandedDiv(panelProps, state)}\n </TopLayerPositioner>\n )}\n {...rest}\n >\n <LayerEscapeTarget element={() => panel}>{props.children}</LayerEscapeTarget>\n </UiAlertDialogContent>\n </Portal>\n )\n}\n\nexport function AlertDialogHeader(props: ComponentProps<'div'>) {\n const rest = omit(props, 'class')\n return <div data-slot=\"alert-dialog-header\" class={cn(overlayHeader, props.class)} {...rest} />\n}\n\nexport function AlertDialogFooter(props: ComponentProps<'div'>) {\n const rest = omit(props, 'class')\n return <div data-slot=\"alert-dialog-footer\" class={cn(overlayFooter, props.class)} {...rest} />\n}\n\nexport function AlertDialogTitle(props: PolymorphicPartProps<'h2'>) {\n return (\n <UiAlertDialogTitle\n class={cn(overlayTitle, props.class)}\n render={asRender(props.as, () => props['data-slot'])}\n {...omit(props, 'class', 'as')}\n />\n )\n}\n\nexport function AlertDialogDescription(props: PolymorphicPartProps<'p'>) {\n return (\n <UiAlertDialogDescription\n class={cn(overlayDescription, props.class)}\n render={asRender(props.as, () => props['data-slot'])}\n {...omit(props, 'class', 'as')}\n />\n )\n}\n\n/**\n * One of the dialog's two named choices.\n *\n * Both are ui-sdk Close parts: they close the dialog, and their visible text is\n * their accessible name. (Kobalte labelled every close button \"Dismiss\", which\n * replaced the visible text, so a screen reader heard \"Dismiss\" twice and could\n * not tell the destructive choice from the safe one; this wrapper used to strip\n * that label. ui-sdk adds none.) A caller whose button is an icon passes its own\n * `aria-label`, and that one is kept.\n *\n * ui-sdk focuses the first Close part on open, so the safe choice, written first\n * by convention, is where a confirmation starts.\n */\nfunction AlertDialogChoice(props: WithAs<ComponentProps<typeof UiAlertDialogClose>>) {\n return (\n <UiAlertDialogClose\n class={cn(props.class)}\n render={asRender(props.as, () => props['data-slot'])}\n {...omit(props, 'class', 'as')}\n />\n )\n}\n\nexport function AlertDialogAction(props: WithAs<ComponentProps<typeof UiAlertDialogClose>>) {\n return <AlertDialogChoice {...props} />\n}\n\nexport function AlertDialogCancel(props: WithAs<ComponentProps<typeof UiAlertDialogClose>>) {\n return <AlertDialogChoice {...props} />\n}\n"],"mappings":";;;;;;;;;;AAoFA,SAAgByB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if (layer.refuses(open, details)) return details.cancel()\n props.onOpenChange?.(open, details)\n }}\n >\n <LayerRootContext value={layer}>{props.children}</LayerRootContext>\n </UiAlertDialog>","onOpenChange={(open, details) => {\n if (layer.refuses(open, details)) return details.cancel()\n props.onOpenChange?.(open, details)\n }}","<LayerRootContext value={layer}>{props.children}</LayerRootContext>","value={layer}","<UiAlertDialogTrigger\n {...omit(props, 'as')}\n render={triggerRender(props.as, 'button', () => props['data-slot'])}\n />","<Portal mount={props.mount ?? overlayContainer()}>{props.children}</Portal>","<UiAlertDialogBackdrop\n class={cn(overlayScrim, overlayScrimMotion, props.class)}\n render={expandedDiv}\n {...omit(props, 'class')}\n />","render={expandedDiv}","<Portal mount={overlayContainer()}>\n <UiAlertDialogContent\n inline\n ref={(element: HTMLDivElement) => {\n panel = element\n forwardRef(() => props.ref, element)\n }}\n initialFocus={props.onOpenAutoFocus ? focus.initialFocus() : undefined}\n finalFocus={focus.finalFocus()}\n class={cn(\n dialogSurface,\n overlayMotion,\n // Positioned, so it paints above the fixed scrim beside it (a static\n // box paints under a positioned sibling whatever their order).\n 'relative grid max-h-full w-full max-w-md gap-4 overflow-y-auto p-5',\n props.class\n )}\n render={(panelProps, state) => (\n <TopLayerPositioner class={overlayPositioner}>\n <DialogScrim open={state.open} />\n {expandedDiv(panelProps, state)}\n </TopLayerPositioner>\n )}\n {...rest}\n >\n <LayerEscapeTarget element={() => panel}>{props.children}</LayerEscapeTarget>\n </UiAlertDialogContent>\n </Portal>","<UiAlertDialogContent\n inline\n ref={(element: HTMLDivElement) => {\n panel = element\n forwardRef(() => props.ref, element)\n }}\n initialFocus={props.onOpenAutoFocus ? focus.initialFocus() : undefined}\n finalFocus={focus.finalFocus()}\n class={cn(\n dialogSurface,\n overlayMotion,\n // Positioned, so it paints above the fixed scrim beside it (a static\n // box paints under a positioned sibling whatever their order).\n 'relative grid max-h-full w-full max-w-md gap-4 overflow-y-auto p-5',\n props.class\n )}\n render={(panelProps, state) => (\n <TopLayerPositioner class={overlayPositioner}>\n <DialogScrim open={state.open} />\n {expandedDiv(panelProps, state)}\n </TopLayerPositioner>\n )}\n {...rest}\n >\n <LayerEscapeTarget element={() => panel}>{props.children}</LayerEscapeTarget>\n </UiAlertDialogContent>","ref={(element: HTMLDivElement) => {\n panel = element\n forwardRef(() => props.ref, element)\n }}","props.onOpenAutoFocus ? focus.initialFocus() : undefined","render={(panelProps, state) => (\n <TopLayerPositioner class={overlayPositioner}>\n <DialogScrim open={state.open} />\n {expandedDiv(panelProps, state)}\n </TopLayerPositioner>\n )}","<TopLayerPositioner class={overlayPositioner}>\n <DialogScrim open={state.open} />\n {expandedDiv(panelProps, state)}\n </TopLayerPositioner>","class={overlayPositioner}","<DialogScrim open={state.open} />","expandedDiv(panelProps, state)","<LayerEscapeTarget element={() => panel}>{props.children}</LayerEscapeTarget>","element={() => panel}","<div data-slot=\"alert-dialog-header\" class={cn(overlayHeader, props.class)} {...rest} />","<div data-slot=\"alert-dialog-footer\" class={cn(overlayFooter, props.class)} {...rest} />","<UiAlertDialogTitle\n class={cn(overlayTitle, props.class)}\n render={asRender(props.as, () => props['data-slot'])}\n {...omit(props, 'class', 'as')}\n />","<UiAlertDialogDescription\n class={cn(overlayDescription, props.class)}\n render={asRender(props.as, () => props['data-slot'])}\n {...omit(props, 'class', 'as')}\n />","<UiAlertDialogClose\n class={cn(props.class)}\n render={asRender(props.as, () => props['data-slot'])}\n {...omit(props, 'class', 'as')}\n />","<AlertDialogChoice {...props} />","_$spread"],"sources":["../../../../src/components/ui/alert-dialog/alert-dialog.tsx"],"sourcesContent":["import {\n AlertDialog as UiAlertDialog,\n AlertDialogBackdrop as UiAlertDialogBackdrop,\n AlertDialogClose as UiAlertDialogClose,\n AlertDialogContent as UiAlertDialogContent,\n AlertDialogDescription as UiAlertDialogDescription,\n AlertDialogTitle as UiAlertDialogTitle,\n AlertDialogTrigger as UiAlertDialogTrigger,\n createAlertDialogController,\n type AlertDialogOptions,\n} from '@ui-sdk/solid/alert-dialog'\nimport type { DialogOpenChangeDetails } from '@ui-sdk/solid/dialog'\nimport type { PartProps } from '@ui-sdk/solid/primitive'\nimport type { Accessor } from 'solid-js'\nimport type { ComponentProps, JSX, ValidComponent } from '@solidjs/web'\nimport { omit } from 'solid-js'\nimport { Portal } from '@solidjs/web'\nimport {\n dialogSurface,\n overlayDescription,\n overlayFooter,\n overlayHeader,\n overlayMotion,\n overlayPositioner,\n overlayScrim,\n overlayScrimMotion,\n overlayTitle,\n} from '#lib/overlay'\nimport { cn } from '#lib/utils'\nimport {\n asRender,\n triggerRender,\n expandedDiv,\n overlayContainer,\n type WithAs,\n} from '../tooltip/tooltip'\nimport {\n createLayerRoot,\n LayerEscapeTarget,\n type LayerHandlers,\n layerHandlerProps,\n layerHandlers,\n LayerRootContext,\n DialogScrim,\n TopLayerPositioner,\n useLayerContent,\n} from '../dialog/dialog-layer'\nimport { forwardRef } from '#lib/refs'\n\n/**\n * AlertDialog.\n *\n * A dialog that cannot be dismissed by accident: a click on the scrim does nothing,\n * and the user must choose one of the actions. Escape is the keyboard's Cancel: it\n * closes the dialog exactly as the cancel action does, so nothing is confirmed. That\n * is the whole difference from Dialog, and it is why this exists as its own\n * component rather than a prop, a caller has to reach for it deliberately.\n *\n * The consequence is a rule of use: this is for confirming a destructive or\n * irreversible step. Wrapping an ordinary form in an AlertDialog traps someone who\n * wants to back out.\n *\n * There is deliberately no close button in the corner. An X has no label, and the\n * point of this surface is that every exit is a named choice.\n *\n * ui-sdk's alert dialog is that surface already: always modal, never closed by a\n * press outside, `role=\"alertdialog\"`, its first Close part focused on open.\n * Escape is left to it. It can only ever cancel, never confirm, so it is not an\n * accident that matters; refusing it traps a keyboard user who has changed their\n * mind, and the WAI-ARIA alertdialog pattern says Escape closes. It reports\n * `onOpenChange(false)` and returns focus to the trigger, or to what had focus\n * before the confirmation opened, which is what the cancel action does; as the\n * topmost layer it closes only the confirmation, not a dialog underneath.\n */\nexport type AlertDialogProps = Omit<AlertDialogOptions, 'onOpenChange' | 'controller'> & {\n children?: JSX.Element\n /** The dialog wants to open or close. The second argument is ui-sdk's change details. */\n onOpenChange?: (open: boolean, details: DialogOpenChangeDetails) => void\n /** Kept for the API: an alert dialog always locks the page's scroll. */\n preventScroll?: boolean\n /** Kept for the API. */\n forceMount?: boolean\n}\n\nexport function AlertDialog(props: AlertDialogProps) {\n const controller = createAlertDialogController()\n const layer = createLayerRoot(() => controller.close({ reason: 'escape-key' }))\n const rest = omit(\n props as AlertDialogProps & Record<string, unknown>,\n 'children',\n 'onOpenChange',\n 'preventScroll',\n 'forceMount',\n 'id',\n 'translations',\n 'modal'\n )\n return (\n <UiAlertDialog\n {...(rest as AlertDialogOptions)}\n controller={controller}\n onOpenChange={(open, details) => {\n if (layer.refuses(open, details)) return details.cancel()\n props.onOpenChange?.(open, details)\n }}\n >\n <LayerRootContext value={layer}>{props.children}</LayerRootContext>\n </UiAlertDialog>\n )\n}\n\ntype PolymorphicPartProps<Tag extends keyof JSX.IntrinsicElements> = PartProps<Tag> & {\n /** Render the part as this component, which must forward props and ref to its element. */\n as?: ValidComponent\n class?: string\n [key: string]: unknown\n}\n\nexport function AlertDialogTrigger(props: WithAs<ComponentProps<typeof UiAlertDialogTrigger>>) {\n return (\n <UiAlertDialogTrigger\n {...omit(props, 'as')}\n render={triggerRender(props.as, 'button', () => props['data-slot'])}\n />\n )\n}\n\n/** Renders its children into `<body>`. The content already does; kept for the API. */\nexport function AlertDialogPortal(props: { children?: JSX.Element; mount?: Element }) {\n return <Portal mount={props.mount ?? overlayContainer()}>{props.children}</Portal>\n}\n\n/** The scrim as a part of its own. `AlertDialogContent` already draws one. */\nexport function AlertDialogOverlay(props: PartProps<'div'> & { class?: string }) {\n return (\n <UiAlertDialogBackdrop\n class={cn(overlayScrim, overlayScrimMotion, props.class)}\n render={expandedDiv}\n {...omit(props, 'class')}\n />\n )\n}\n\nexport type AlertDialogContentProps = Omit<\n ComponentProps<typeof UiAlertDialogContent>,\n 'class' | 'children' | 'ref' | 'render' | 'keepMounted' | 'inline' | keyof LayerHandlers\n> &\n LayerHandlers & {\n class?: string\n children?: JSX.Element\n ref?: ((element: HTMLDivElement) => void) | HTMLDivElement\n /** The control to focus on close when the one focused before opening is gone by then. */\n restoreFocusRef?: Accessor<HTMLElement | undefined>\n }\n\n/**\n * The panel, in a top-layer positioner like Dialog's (see `TopLayerPositioner`).\n * A press on the scrim lands on that positioner, outside the panel, and ui-sdk's\n * alert dialog never closes on it.\n */\nexport function AlertDialogContent(props: AlertDialogContentProps) {\n let panel: HTMLDivElement | undefined\n const rest = omit(props, 'class', 'children', 'ref', 'restoreFocusRef', ...layerHandlerProps)\n const focus = useLayerContent({\n content: () => panel,\n handlers: layerHandlers(props),\n restoreFocusRef: () => props.restoreFocusRef?.(),\n })\n\n return (\n <Portal mount={overlayContainer()}>\n <UiAlertDialogContent\n inline\n ref={(element: HTMLDivElement) => {\n panel = element\n forwardRef(() => props.ref, element)\n }}\n initialFocus={props.onOpenAutoFocus ? focus.initialFocus() : undefined}\n finalFocus={focus.finalFocus()}\n class={cn(\n dialogSurface,\n overlayMotion,\n // Positioned, so it paints above the fixed scrim beside it (a static\n // box paints under a positioned sibling whatever their order).\n 'relative grid max-h-full w-full max-w-md gap-4 overflow-y-auto p-5',\n props.class\n )}\n render={(panelProps, state) => (\n <TopLayerPositioner class={overlayPositioner}>\n <DialogScrim open={state.open} />\n {expandedDiv(panelProps, state)}\n </TopLayerPositioner>\n )}\n {...rest}\n >\n <LayerEscapeTarget element={() => panel}>{props.children}</LayerEscapeTarget>\n </UiAlertDialogContent>\n </Portal>\n )\n}\n\nexport function AlertDialogHeader(props: ComponentProps<'div'>) {\n const rest = omit(props, 'class')\n return <div data-slot=\"alert-dialog-header\" class={cn(overlayHeader, props.class)} {...rest} />\n}\n\nexport function AlertDialogFooter(props: ComponentProps<'div'>) {\n const rest = omit(props, 'class')\n return <div data-slot=\"alert-dialog-footer\" class={cn(overlayFooter, props.class)} {...rest} />\n}\n\nexport function AlertDialogTitle(props: PolymorphicPartProps<'h2'>) {\n return (\n <UiAlertDialogTitle\n class={cn(overlayTitle, props.class)}\n render={asRender(props.as, () => props['data-slot'])}\n {...omit(props, 'class', 'as')}\n />\n )\n}\n\nexport function AlertDialogDescription(props: PolymorphicPartProps<'p'>) {\n return (\n <UiAlertDialogDescription\n class={cn(overlayDescription, props.class)}\n render={asRender(props.as, () => props['data-slot'])}\n {...omit(props, 'class', 'as')}\n />\n )\n}\n\n/**\n * One of the dialog's two named choices.\n *\n * Both are ui-sdk Close parts: they close the dialog, and their visible text is\n * their accessible name. (Kobalte labelled every close button \"Dismiss\", which\n * replaced the visible text, so a screen reader heard \"Dismiss\" twice and could\n * not tell the destructive choice from the safe one; this wrapper used to strip\n * that label. ui-sdk adds none.) A caller whose button is an icon passes its own\n * `aria-label`, and that one is kept.\n *\n * ui-sdk focuses the first Close part on open, so the safe choice, written first\n * by convention, is where a confirmation starts.\n */\nfunction AlertDialogChoice(props: WithAs<ComponentProps<typeof UiAlertDialogClose>>) {\n return (\n <UiAlertDialogClose\n class={cn(props.class)}\n render={asRender(props.as, () => props['data-slot'])}\n {...omit(props, 'class', 'as')}\n />\n )\n}\n\nexport function AlertDialogAction(props: WithAs<ComponentProps<typeof UiAlertDialogClose>>) {\n return <AlertDialogChoice {...props} />\n}\n\nexport function AlertDialogCancel(props: WithAs<ComponentProps<typeof UiAlertDialogClose>>) {\n return <AlertDialogChoice {...props} />\n}\n"],"mappings":";;;;;;;;;;AAoFA,SAAgB,YAAY,OAAyB;CACnD,MAAM,aAAa,4BAA4B;CAC/C,MAAM,QAAQ,sBAAsB,WAAW,MAAM,EAAE,QAAQ,aAAa,CAAC,CAAC;CAC9E,MAAM,OAAO,KACX,OACA,YACA,gBACA,iBACA,cACA,MACA,gBACA,OACF;CACA,OACEA,gBAAAA,eAAAA,WACO,MADP;EAEc;EACZC,eAAe,MAAM,YAAY;GAC/B,IAAI,MAAM,QAAQ,MAAM,OAAO,GAAG,OAAO,QAAQ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IAAA,SAAA;GAAQ,OAAA,SAAS,MAAM,UAAU,MAAM,YAAY;EAAC;CAErD,SADC;EAAI,OAAA,KAAK,OAAO,SAAS,IAAI;CAAC,CAC/B,CAAA;AAEL;AAEA,SAAgB,uBAAuB,OAAkC;CACvE,OACEC,gBAAAA,0BAAAA,WAAAA;EACE,IAAA,UAAA;GAAO,OAAA,GAAG,oBAAoB,MAAM,KAAK;EAAC;EAC1C,IAAA,SAAA;GAAQ,OAAA,SAAS,MAAM,UAAU,MAAM,YAAY;EAAC;CAErD,SADC;EAAI,OAAA,KAAK,OAAO,SAAS,IAAI;CAAC,CAC/B,CAAA;AAEL;;;;;;;;;;;;;;AAeA,SAAS,kBAAkB,OAA0D;CACnF,OACEC,gBAAAA,kBAAAA,WAAAA;EACE,IAAA,UAAA;GAAO,OAAA,GAAG,MAAM,KAAK;EAAC;EACtB,IAAA,SAAA;GAAQ,OAAA,SAAS,MAAM,UAAU,MAAM,YAAY;EAAC;CAErD,SADC;EAAI,OAAA,KAAK,OAAO,SAAS,IAAI;CAAC,CAC/B,CAAA;AAEL;AAEA,SAAgB,kBAAkB,OAA0D;CAC1F,OAAOC,gBAAAA,mBAAuB,KAAQ;AACxC;AAEA,SAAgB,kBAAkB,OAA0D;CAC1F,OAAOA,gBAAAA,mBAAuB,KAAQ;AACxC"}
@@ -1,8 +1,8 @@
1
- import { cn } from "../../../lib/utils.js";
2
- import { clampSurfaceFraction, normalizedSurfacePoint } from "./geometry.js";
3
1
  import { className, createComponent, delegateEvents, effect, insert, memo, readShallow, ref, setAttribute, template } from "@solidjs/web";
4
2
  import { Show, children, createEffect, createSignal, createUniqueId, onCleanup } from "solid-js";
3
+ import { cn } from "../../../lib/utils.js";
5
4
  import "./annotation-surface.css";
5
+ import { clampSurfaceFraction, normalizedSurfacePoint } from "./geometry.js";
6
6
  // src/components/ui/annotation-surface/annotation-surface.tsx
7
7
  var _tmpl$ = /* @__PURE__ */ template(`<div role=application aria-roledescription="annotation surface"tabindex=0><!><!>`);
8
8
  var _tmpl$2 = /* @__PURE__ */ template(`<svg class="dev-annotation-surface__region pointer-events-none absolute inset-0 size-full"viewBox="0 0 10000 10000"preserveAspectRatio=none aria-hidden=true><rect class="fill-primary-subtle stroke-primary"stroke-width=1.5 vector-effect=non-scaling-stroke>`);
@@ -1 +1 @@
1
- {"version":3,"file":"annotation-surface.js","names":["ref={(element) => local.ref?.(element)}","<Show when={visibleRegion()}>\n {(region) => (\n <svg\n class=\"dev-annotation-surface__region pointer-events-none absolute inset-0 size-full\"\n viewBox=\"0 0 10000 10000\"\n preserveAspectRatio=\"none\"\n aria-hidden=\"true\"\n >\n <rect\n class=\"fill-primary-subtle stroke-primary\"\n x={region().x * 10_000}\n y={region().y * 10_000}\n width={region().width * 10_000}\n height={region().height * 10_000}\n stroke-width=\"1.5\"\n vector-effect=\"non-scaling-stroke\"\n />\n </svg>\n )}\n </Show>","y={region().y * 10_000}","width={region().width * 10_000}","height={region().height * 10_000}","<div\n id={local.id}\n aria-describedby={describedBy()}\n role=\"application\"\n aria-roledescription=\"annotation surface\"\n aria-label={local.label}\n aria-disabled={isInteractive() ? undefined : 'true'}\n tabindex={0}\n data-tool={local.tool}\n data-dragging={dragging() ? 'true' : 'false'}\n class={cn(\n 'dev-annotation-surface relative isolate block w-full aspect-video select-none overflow-hidden rounded-md border border-border bg-muted/20 text-muted-foreground outline-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle',\n local.class\n )}\n ref={(element) => local.ref?.(element)}\n onPointerDown={handlePointerDown}\n onPointerMove={handlePointerMove}\n onPointerUp={handlePointerUp}\n onPointerCancel={handlePointerCancel}\n onLostPointerCapture={handleLostPointerCapture}\n onKeyDown={handleKeyDown}\n >\n <Show when={visibleRegion()}>\n {(region) => (\n <svg\n class=\"dev-annotation-surface__region pointer-events-none absolute inset-0 size-full\"\n viewBox=\"0 0 10000 10000\"\n preserveAspectRatio=\"none\"\n aria-hidden=\"true\"\n >\n <rect\n class=\"fill-primary-subtle stroke-primary\"\n x={region().x * 10_000}\n y={region().y * 10_000}\n width={region().width * 10_000}\n height={region().height * 10_000}\n stroke-width=\"1.5\"\n vector-effect=\"non-scaling-stroke\"\n />\n </svg>\n )}\n </Show>\n <Show when={hint() && !visibleRegion()}>\n <span\n id={hintId}\n class=\"dev-annotation-surface__hint pointer-events-none absolute inset-0 grid place-items-center p-4 text-center text-xs text-muted-foreground\"\n >\n {hint()}\n </span>\n </Show>\n </div>","aria-describedby={describedBy()}","aria-label={local.label}","aria-disabled={isInteractive() ? undefined : 'true'}","data-tool={local.tool}","data-dragging={dragging() ? 'true' : 'false'}","class={cn(\n 'dev-annotation-surface relative isolate block w-full aspect-video select-none overflow-hidden rounded-md border border-border bg-muted/20 text-muted-foreground outline-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle',\n local.class\n )}","_$setAttribute"],"sources":["../../../../src/components/ui/annotation-surface/annotation-surface.tsx"],"sourcesContent":["import { children, createEffect, createSignal, createUniqueId, onCleanup, Show } from 'solid-js'\nimport { type JSX } from '@solidjs/web'\nimport { cn } from '#lib/utils'\nimport './annotation-surface.css'\nimport {\n clampSurfaceFraction,\n normalizedSurfacePoint,\n type AnnotationSurfacePoint,\n} from './geometry'\n\nexport type AnnotationSurfaceRegion = Readonly<{\n x: number\n y: number\n width: number\n height: number\n}>\n\nexport type AnnotationSurfaceDrag = Readonly<{\n start: AnnotationSurfacePoint\n current: AnnotationSurfacePoint\n}>\n\nexport type AnnotationSurfaceTool = 'region' | 'point'\nexport type AnnotationSurfaceDragPhase = 'start' | 'move' | 'end' | 'cancel' | 'keyboard'\nexport type AnnotationSurfacePointerEvent = PointerEvent & { currentTarget: HTMLDivElement }\nexport type AnnotationSurfaceKeyboardEvent = KeyboardEvent & { currentTarget: HTMLDivElement }\nexport type AnnotationSurfaceInputEvent =\n | AnnotationSurfacePointerEvent\n | AnnotationSurfaceKeyboardEvent\n\ntype SurfaceElementProps = Pick<JSX.HTMLAttributes<HTMLDivElement>, 'id' | 'aria-describedby'>\n\nexport type AnnotationSurfaceProps = SurfaceElementProps & {\n /** Accessible instructions for the keyboard-operated surface. */\n label: string\n /** Region draws a captured drag; point reports a single placement point. */\n tool: AnnotationSurfaceTool\n /** Normalized 0..1 geometry supplied by the host; absent means no region. */\n region?: AnnotationSurfaceRegion\n /** Visible idle guidance. It is hidden while a region is present. */\n hint?: JSX.Element\n /** Disable new drawing while the host is busy. Defaults to true. */\n interactive?: boolean\n /** Changing this value cancels an in-flight drag owned by the host context. */\n resetKey?: string | number\n /** Receives one normalized point in point mode. */\n onPoint?: (point: AnnotationSurfacePoint, event: AnnotationSurfaceInputEvent) => void\n /** Receives drag phases; cancel has no drag and fires at most once per capture. */\n onDragChange?: (\n drag: AnnotationSurfaceDrag | undefined,\n phase: AnnotationSurfaceDragPhase,\n event?: AnnotationSurfaceInputEvent\n ) => void\n /** Domain keyboard policy stays with the host and receives the native event. */\n onKeyDown?: (event: AnnotationSurfaceKeyboardEvent) => void\n /** Ref to the actual focusable and pointer-capturing HTMLDivElement. */\n ref?: (element: HTMLDivElement) => void\n /** Layout only; appearance remains owned by the shared component. */\n class?: string\n}\n\ntype ActiveDrag = AnnotationSurfaceDrag & {\n pointerId: number\n target: HTMLDivElement\n}\n\nfunction pointFrom(event: PointerEvent, target: HTMLDivElement): AnnotationSurfacePoint {\n const bounds = target.getBoundingClientRect()\n return normalizedSurfacePoint(event.clientX, event.clientY, bounds)\n}\n\n/**\n * AnnotationSurface.\n *\n * A keyboard-focusable, viewport-shaped drawing surface for hosts that own an\n * annotation domain. It renders normalized region geometry and idle guidance,\n * captures region drags, and reports normalized points without reading or\n * rendering screenshot pixels. The host keeps tool policy, domain geometry,\n * persistence and capture commands.\n *\n * This bespoke application widget is necessary because a generic button or\n * slider cannot represent a two-dimensional drawing viewport. Its keyboard\n * behavior is supplied by the host and forwarded as a native key event. Space\n * creates a centered region or places a point at the center; Escape is left to\n * the host first, which can prevent the default gesture cancellation while it\n * applies its own draft and mode rules.\n */\nexport function AnnotationSurface(props: AnnotationSurfaceProps) {\n const local = props\n\n const [dragging, setDragging] = createSignal(false)\n const hintId = createUniqueId()\n // The hint is JSX: read once, or every check of it builds another copy.\n const hint = children(() => local.hint)\n let activeDrag: ActiveDrag | undefined\n\n const isInteractive = () => local.interactive ?? true\n\n function releaseCapture(drag: ActiveDrag): void {\n try {\n if (drag.target.hasPointerCapture(drag.pointerId))\n drag.target.releasePointerCapture(drag.pointerId)\n } catch {\n // The browser may release capture while a host reset or unmount is running.\n }\n }\n\n function cancelDrag(event?: AnnotationSurfaceInputEvent, release = true): void {\n const drag = activeDrag\n if (!drag) return\n\n activeDrag = undefined\n setDragging(false)\n if (release) releaseCapture(drag)\n local.onDragChange?.(undefined, 'cancel', event)\n }\n\n // A host reset, a tool switch or the surface turning inert ends a drag in flight.\n createEffect(\n () => ({ resetKey: local.resetKey, tool: local.tool, interactive: isInteractive() }),\n (next, previous) => {\n if (!activeDrag) return\n if (\n !next.interactive ||\n (previous && (next.resetKey !== previous.resetKey || next.tool !== previous.tool))\n )\n cancelDrag()\n }\n )\n\n onCleanup(() => cancelDrag())\n\n function handlePointerDown(event: AnnotationSurfacePointerEvent): void {\n if (!isInteractive() || !event.isPrimary || event.button !== 0) return\n event.preventDefault()\n event.currentTarget.focus({ preventScroll: true })\n const point = pointFrom(event, event.currentTarget)\n if (activeDrag) return\n\n if (local.tool === 'point') {\n local.onPoint?.(point, event)\n return\n }\n\n try {\n event.currentTarget.setPointerCapture(event.pointerId)\n } catch {\n // A drag without real pointer capture can lose its final coordinates.\n return\n }\n\n const drag: ActiveDrag = {\n pointerId: event.pointerId,\n target: event.currentTarget,\n start: point,\n current: point,\n }\n activeDrag = drag\n setDragging(true)\n local.onDragChange?.({ start: point, current: point }, 'start', event)\n }\n\n function handlePointerMove(event: AnnotationSurfacePointerEvent): void {\n const drag = activeDrag\n if (!drag || drag.pointerId !== event.pointerId) return\n\n const current = pointFrom(event, event.currentTarget)\n activeDrag = { ...drag, current }\n local.onDragChange?.({ start: drag.start, current }, 'move', event)\n }\n\n function handlePointerUp(event: AnnotationSurfacePointerEvent): void {\n const drag = activeDrag\n if (!drag || drag.pointerId !== event.pointerId) return\n\n const current = pointFrom(event, event.currentTarget)\n activeDrag = undefined\n setDragging(false)\n releaseCapture(drag)\n local.onDragChange?.({ start: drag.start, current }, 'end', event)\n }\n\n function handlePointerCancel(event: AnnotationSurfacePointerEvent): void {\n if (activeDrag?.pointerId === event.pointerId) cancelDrag(event)\n }\n\n function handleLostPointerCapture(event: AnnotationSurfacePointerEvent): void {\n if (activeDrag?.pointerId === event.pointerId) cancelDrag(event, false)\n }\n\n function handleKeyDown(event: AnnotationSurfaceKeyboardEvent): void {\n local.onKeyDown?.(event)\n if (event.key === 'Escape') {\n if (!event.defaultPrevented) cancelDrag()\n return\n }\n if (\n event.defaultPrevented ||\n !isInteractive() ||\n event.key !== ' ' ||\n event.repeat ||\n event.isComposing ||\n event.altKey ||\n event.ctrlKey ||\n event.metaKey ||\n activeDrag\n )\n return\n\n event.preventDefault()\n if (local.tool === 'point') {\n local.onPoint?.({ x: 0.5, y: 0.5 }, event)\n return\n }\n\n local.onDragChange?.(\n {\n start: { x: 0.25, y: 0.25 },\n current: { x: 0.75, y: 0.75 },\n },\n 'keyboard',\n event\n )\n }\n\n const visibleRegion = (): AnnotationSurfaceRegion | undefined => {\n const region = local.region\n if (!region) return undefined\n const x = clampSurfaceFraction(region.x)\n const y = clampSurfaceFraction(region.y)\n return {\n x,\n y,\n width: Math.min(clampSurfaceFraction(region.width), 1 - x),\n height: Math.min(clampSurfaceFraction(region.height), 1 - y),\n }\n }\n\n const describedBy = () =>\n [local['aria-describedby'], hint() && !visibleRegion() ? hintId : undefined]\n .filter(Boolean)\n .join(' ') || undefined\n\n return (\n <div\n id={local.id}\n aria-describedby={describedBy()}\n role=\"application\"\n aria-roledescription=\"annotation surface\"\n aria-label={local.label}\n aria-disabled={isInteractive() ? undefined : 'true'}\n tabindex={0}\n data-tool={local.tool}\n data-dragging={dragging() ? 'true' : 'false'}\n class={cn(\n 'dev-annotation-surface relative isolate block w-full aspect-video select-none overflow-hidden rounded-md border border-border bg-muted/20 text-muted-foreground outline-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle',\n local.class\n )}\n ref={(element) => local.ref?.(element)}\n onPointerDown={handlePointerDown}\n onPointerMove={handlePointerMove}\n onPointerUp={handlePointerUp}\n onPointerCancel={handlePointerCancel}\n onLostPointerCapture={handleLostPointerCapture}\n onKeyDown={handleKeyDown}\n >\n <Show when={visibleRegion()}>\n {(region) => (\n <svg\n class=\"dev-annotation-surface__region pointer-events-none absolute inset-0 size-full\"\n viewBox=\"0 0 10000 10000\"\n preserveAspectRatio=\"none\"\n aria-hidden=\"true\"\n >\n <rect\n class=\"fill-primary-subtle stroke-primary\"\n x={region().x * 10_000}\n y={region().y * 10_000}\n width={region().width * 10_000}\n height={region().height * 10_000}\n stroke-width=\"1.5\"\n vector-effect=\"non-scaling-stroke\"\n />\n </svg>\n )}\n </Show>\n <Show when={hint() && !visibleRegion()}>\n <span\n id={hintId}\n class=\"dev-annotation-surface__hint pointer-events-none absolute inset-0 grid place-items-center p-4 text-center text-xs text-muted-foreground\"\n >\n {hint()}\n </span>\n </Show>\n </div>\n )\n}\n"],"mappings":";;;;;;;;;AAkEA,SAAS,UAAU,OAAqB,QAAgD;CACtF,MAAM,SAAS,OAAO,sBAAsB;CAC5C,OAAO,uBAAuB,MAAM,SAAS,MAAM,SAAS,MAAM;AACpE;;;;;;;;;;;;;;;;;AAkBA,SAAgB,kBAAkB,OAA+B;CAC/D,MAAM,QAAQ;CAEd,MAAM,CAAC,UAAU,eAAe,aAAa,KAAK;CAClD,MAAM,SAAS,eAAe;CAE9B,MAAM,OAAO,eAAe,MAAM,IAAI;CACtC,IAAI;CAEJ,MAAM,sBAAsB,MAAM,eAAe;CAEjD,SAAS,eAAe,MAAwB;EAC9C,IAAI;GACF,IAAI,KAAK,OAAO,kBAAk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OM,OAAA,IAAA,WANJ;IAKM,IAAA,QAAA,QAAA;IAJJ,aAAA,OAAA,MAAI,MAAM;IADZ,OAAA,OAIG,IACG;IALN,OAAA;GAKM,EAAA,CAAA,IANR,KAAA;EAOM;CAAC,EAAA,CAAD,GAjDRA,KAkDK;CAjDH,aAAA;;GAAI,GAAA,MAAM;GACVC,GAAkB,YAAY;GAG9BC,GAAY,MAAM;GAClBC,GAAe,cAAc,IAAI,KAAA,IAAY;GAE7CC,GAAW,MAAM;GACjBC,GAAe,SAAS,IAAI,SAAS;GACrCC,GAAAA,YAAO,GACL,iQACA,MAAM,KACR,CAAC;EAZW;CAAZ,IAAA,EAAA,GAAA,GAAA,GAAA,GAAA,GAAA,GAAA,KAAA,QAAA;EAAY,MAAA,KAAA,KAAAC,aAAA,MAAA,MAAA,CAAA;EACZ,MAAA,KAAA,KAAAA,aAAA,MAAA,oBAAA,CAA+B;EAG/B,MAAA,KAAA,KAAAA,aAAA,MAAA,cAAA,CAAuB;EACvB,MAAA,KAAA,KAAAA,aAAA,MAAA,iBAAA,CAAmD;EAEnD,MAAA,KAAA,KAAAA,aAAA,MAAA,aAAA,CAAqB;EACrB,MAAA,KAAA,KAAAA,aAAA,MAAA,iBAAA,CAA4C;EAC5C,UAAA,MAAA,GAAA,KAAA,CAGC;CAZW,CAAA;CAFhB,OACEP;AAoDJ"}
1
+ {"version":3,"file":"annotation-surface.js","names":["ref={(element) => local.ref?.(element)}","<Show when={visibleRegion()}>\n {(region) => (\n <svg\n class=\"dev-annotation-surface__region pointer-events-none absolute inset-0 size-full\"\n viewBox=\"0 0 10000 10000\"\n preserveAspectRatio=\"none\"\n aria-hidden=\"true\"\n >\n <rect\n class=\"fill-primary-subtle stroke-primary\"\n x={region().x * 10_000}\n y={region().y * 10_000}\n width={region().width * 10_000}\n height={region().height * 10_000}\n stroke-width=\"1.5\"\n vector-effect=\"non-scaling-stroke\"\n />\n </svg>\n )}\n </Show>","y={region().y * 10_000}","width={region().width * 10_000}","height={region().height * 10_000}","<div\n id={local.id}\n aria-describedby={describedBy()}\n role=\"application\"\n aria-roledescription=\"annotation surface\"\n aria-label={local.label}\n aria-disabled={isInteractive() ? undefined : 'true'}\n tabindex={0}\n data-tool={local.tool}\n data-dragging={dragging() ? 'true' : 'false'}\n class={cn(\n 'dev-annotation-surface relative isolate block w-full aspect-video select-none overflow-hidden rounded-md border border-border bg-muted/20 text-muted-foreground outline-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle',\n local.class\n )}\n ref={(element) => local.ref?.(element)}\n onPointerDown={handlePointerDown}\n onPointerMove={handlePointerMove}\n onPointerUp={handlePointerUp}\n onPointerCancel={handlePointerCancel}\n onLostPointerCapture={handleLostPointerCapture}\n onKeyDown={handleKeyDown}\n >\n <Show when={visibleRegion()}>\n {(region) => (\n <svg\n class=\"dev-annotation-surface__region pointer-events-none absolute inset-0 size-full\"\n viewBox=\"0 0 10000 10000\"\n preserveAspectRatio=\"none\"\n aria-hidden=\"true\"\n >\n <rect\n class=\"fill-primary-subtle stroke-primary\"\n x={region().x * 10_000}\n y={region().y * 10_000}\n width={region().width * 10_000}\n height={region().height * 10_000}\n stroke-width=\"1.5\"\n vector-effect=\"non-scaling-stroke\"\n />\n </svg>\n )}\n </Show>\n <Show when={hint() && !visibleRegion()}>\n <span\n id={hintId}\n class=\"dev-annotation-surface__hint pointer-events-none absolute inset-0 grid place-items-center p-4 text-center text-xs text-muted-foreground\"\n >\n {hint()}\n </span>\n </Show>\n </div>","aria-describedby={describedBy()}","aria-label={local.label}","aria-disabled={isInteractive() ? undefined : 'true'}","data-tool={local.tool}","data-dragging={dragging() ? 'true' : 'false'}","class={cn(\n 'dev-annotation-surface relative isolate block w-full aspect-video select-none overflow-hidden rounded-md border border-border bg-muted/20 text-muted-foreground outline-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle',\n local.class\n )}","_$ref","_$insert","_$effect","_$setAttribute","_$className"],"sources":["../../../../src/components/ui/annotation-surface/annotation-surface.tsx"],"sourcesContent":["import { children, createEffect, createSignal, createUniqueId, onCleanup, Show } from 'solid-js'\nimport { type JSX } from '@solidjs/web'\nimport { cn } from '#lib/utils'\nimport './annotation-surface.css'\nimport {\n clampSurfaceFraction,\n normalizedSurfacePoint,\n type AnnotationSurfacePoint,\n} from './geometry'\n\nexport type AnnotationSurfaceRegion = Readonly<{\n x: number\n y: number\n width: number\n height: number\n}>\n\nexport type AnnotationSurfaceDrag = Readonly<{\n start: AnnotationSurfacePoint\n current: AnnotationSurfacePoint\n}>\n\nexport type AnnotationSurfaceTool = 'region' | 'point'\nexport type AnnotationSurfaceDragPhase = 'start' | 'move' | 'end' | 'cancel' | 'keyboard'\nexport type AnnotationSurfacePointerEvent = PointerEvent & { currentTarget: HTMLDivElement }\nexport type AnnotationSurfaceKeyboardEvent = KeyboardEvent & { currentTarget: HTMLDivElement }\nexport type AnnotationSurfaceInputEvent =\n | AnnotationSurfacePointerEvent\n | AnnotationSurfaceKeyboardEvent\n\ntype SurfaceElementProps = Pick<JSX.HTMLAttributes<HTMLDivElement>, 'id' | 'aria-describedby'>\n\nexport type AnnotationSurfaceProps = SurfaceElementProps & {\n /** Accessible instructions for the keyboard-operated surface. */\n label: string\n /** Region draws a captured drag; point reports a single placement point. */\n tool: AnnotationSurfaceTool\n /** Normalized 0..1 geometry supplied by the host; absent means no region. */\n region?: AnnotationSurfaceRegion\n /** Visible idle guidance. It is hidden while a region is present. */\n hint?: JSX.Element\n /** Disable new drawing while the host is busy. Defaults to true. */\n interactive?: boolean\n /** Changing this value cancels an in-flight drag owned by the host context. */\n resetKey?: string | number\n /** Receives one normalized point in point mode. */\n onPoint?: (point: AnnotationSurfacePoint, event: AnnotationSurfaceInputEvent) => void\n /** Receives drag phases; cancel has no drag and fires at most once per capture. */\n onDragChange?: (\n drag: AnnotationSurfaceDrag | undefined,\n phase: AnnotationSurfaceDragPhase,\n event?: AnnotationSurfaceInputEvent\n ) => void\n /** Domain keyboard policy stays with the host and receives the native event. */\n onKeyDown?: (event: AnnotationSurfaceKeyboardEvent) => void\n /** Ref to the actual focusable and pointer-capturing HTMLDivElement. */\n ref?: (element: HTMLDivElement) => void\n /** Layout only; appearance remains owned by the shared component. */\n class?: string\n}\n\ntype ActiveDrag = AnnotationSurfaceDrag & {\n pointerId: number\n target: HTMLDivElement\n}\n\nfunction pointFrom(event: PointerEvent, target: HTMLDivElement): AnnotationSurfacePoint {\n const bounds = target.getBoundingClientRect()\n return normalizedSurfacePoint(event.clientX, event.clientY, bounds)\n}\n\n/**\n * AnnotationSurface.\n *\n * A keyboard-focusable, viewport-shaped drawing surface for hosts that own an\n * annotation domain. It renders normalized region geometry and idle guidance,\n * captures region drags, and reports normalized points without reading or\n * rendering screenshot pixels. The host keeps tool policy, domain geometry,\n * persistence and capture commands.\n *\n * This bespoke application widget is necessary because a generic button or\n * slider cannot represent a two-dimensional drawing viewport. Its keyboard\n * behavior is supplied by the host and forwarded as a native key event. Space\n * creates a centered region or places a point at the center; Escape is left to\n * the host first, which can prevent the default gesture cancellation while it\n * applies its own draft and mode rules.\n */\nexport function AnnotationSurface(props: AnnotationSurfaceProps) {\n const local = props\n\n const [dragging, setDragging] = createSignal(false)\n const hintId = createUniqueId()\n // The hint is JSX: read once, or every check of it builds another copy.\n const hint = children(() => local.hint)\n let activeDrag: ActiveDrag | undefined\n\n const isInteractive = () => local.interactive ?? true\n\n function releaseCapture(drag: ActiveDrag): void {\n try {\n if (drag.target.hasPointerCapture(drag.pointerId))\n drag.target.releasePointerCapture(drag.pointerId)\n } catch {\n // The browser may release capture while a host reset or unmount is running.\n }\n }\n\n function cancelDrag(event?: AnnotationSurfaceInputEvent, release = true): void {\n const drag = activeDrag\n if (!drag) return\n\n activeDrag = undefined\n setDragging(false)\n if (release) releaseCapture(drag)\n local.onDragChange?.(undefined, 'cancel', event)\n }\n\n // A host reset, a tool switch or the surface turning inert ends a drag in flight.\n createEffect(\n () => ({ resetKey: local.resetKey, tool: local.tool, interactive: isInteractive() }),\n (next, previous) => {\n if (!activeDrag) return\n if (\n !next.interactive ||\n (previous && (next.resetKey !== previous.resetKey || next.tool !== previous.tool))\n )\n cancelDrag()\n }\n )\n\n onCleanup(() => cancelDrag())\n\n function handlePointerDown(event: AnnotationSurfacePointerEvent): void {\n if (!isInteractive() || !event.isPrimary || event.button !== 0) return\n event.preventDefault()\n event.currentTarget.focus({ preventScroll: true })\n const point = pointFrom(event, event.currentTarget)\n if (activeDrag) return\n\n if (local.tool === 'point') {\n local.onPoint?.(point, event)\n return\n }\n\n try {\n event.currentTarget.setPointerCapture(event.pointerId)\n } catch {\n // A drag without real pointer capture can lose its final coordinates.\n return\n }\n\n const drag: ActiveDrag = {\n pointerId: event.pointerId,\n target: event.currentTarget,\n start: point,\n current: point,\n }\n activeDrag = drag\n setDragging(true)\n local.onDragChange?.({ start: point, current: point }, 'start', event)\n }\n\n function handlePointerMove(event: AnnotationSurfacePointerEvent): void {\n const drag = activeDrag\n if (!drag || drag.pointerId !== event.pointerId) return\n\n const current = pointFrom(event, event.currentTarget)\n activeDrag = { ...drag, current }\n local.onDragChange?.({ start: drag.start, current }, 'move', event)\n }\n\n function handlePointerUp(event: AnnotationSurfacePointerEvent): void {\n const drag = activeDrag\n if (!drag || drag.pointerId !== event.pointerId) return\n\n const current = pointFrom(event, event.currentTarget)\n activeDrag = undefined\n setDragging(false)\n releaseCapture(drag)\n local.onDragChange?.({ start: drag.start, current }, 'end', event)\n }\n\n function handlePointerCancel(event: AnnotationSurfacePointerEvent): void {\n if (activeDrag?.pointerId === event.pointerId) cancelDrag(event)\n }\n\n function handleLostPointerCapture(event: AnnotationSurfacePointerEvent): void {\n if (activeDrag?.pointerId === event.pointerId) cancelDrag(event, false)\n }\n\n function handleKeyDown(event: AnnotationSurfaceKeyboardEvent): void {\n local.onKeyDown?.(event)\n if (event.key === 'Escape') {\n if (!event.defaultPrevented) cancelDrag()\n return\n }\n if (\n event.defaultPrevented ||\n !isInteractive() ||\n event.key !== ' ' ||\n event.repeat ||\n event.isComposing ||\n event.altKey ||\n event.ctrlKey ||\n event.metaKey ||\n activeDrag\n )\n return\n\n event.preventDefault()\n if (local.tool === 'point') {\n local.onPoint?.({ x: 0.5, y: 0.5 }, event)\n return\n }\n\n local.onDragChange?.(\n {\n start: { x: 0.25, y: 0.25 },\n current: { x: 0.75, y: 0.75 },\n },\n 'keyboard',\n event\n )\n }\n\n const visibleRegion = (): AnnotationSurfaceRegion | undefined => {\n const region = local.region\n if (!region) return undefined\n const x = clampSurfaceFraction(region.x)\n const y = clampSurfaceFraction(region.y)\n return {\n x,\n y,\n width: Math.min(clampSurfaceFraction(region.width), 1 - x),\n height: Math.min(clampSurfaceFraction(region.height), 1 - y),\n }\n }\n\n const describedBy = () =>\n [local['aria-describedby'], hint() && !visibleRegion() ? hintId : undefined]\n .filter(Boolean)\n .join(' ') || undefined\n\n return (\n <div\n id={local.id}\n aria-describedby={describedBy()}\n role=\"application\"\n aria-roledescription=\"annotation surface\"\n aria-label={local.label}\n aria-disabled={isInteractive() ? undefined : 'true'}\n tabindex={0}\n data-tool={local.tool}\n data-dragging={dragging() ? 'true' : 'false'}\n class={cn(\n 'dev-annotation-surface relative isolate block w-full aspect-video select-none overflow-hidden rounded-md border border-border bg-muted/20 text-muted-foreground outline-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle',\n local.class\n )}\n ref={(element) => local.ref?.(element)}\n onPointerDown={handlePointerDown}\n onPointerMove={handlePointerMove}\n onPointerUp={handlePointerUp}\n onPointerCancel={handlePointerCancel}\n onLostPointerCapture={handleLostPointerCapture}\n onKeyDown={handleKeyDown}\n >\n <Show when={visibleRegion()}>\n {(region) => (\n <svg\n class=\"dev-annotation-surface__region pointer-events-none absolute inset-0 size-full\"\n viewBox=\"0 0 10000 10000\"\n preserveAspectRatio=\"none\"\n aria-hidden=\"true\"\n >\n <rect\n class=\"fill-primary-subtle stroke-primary\"\n x={region().x * 10_000}\n y={region().y * 10_000}\n width={region().width * 10_000}\n height={region().height * 10_000}\n stroke-width=\"1.5\"\n vector-effect=\"non-scaling-stroke\"\n />\n </svg>\n )}\n </Show>\n <Show when={hint() && !visibleRegion()}>\n <span\n id={hintId}\n class=\"dev-annotation-surface__hint pointer-events-none absolute inset-0 grid place-items-center p-4 text-center text-xs text-muted-foreground\"\n >\n {hint()}\n </span>\n </Show>\n </div>\n )\n}\n"],"mappings":";;;;;;;;;AAkEA,SAAS,UAAU,OAAqB,QAAgD;CACtF,MAAM,SAAS,OAAO,sBAAsB;CAC5C,OAAO,uBAAuB,MAAM,SAAS,MAAM,SAAS,MAAM;AACpE;;;;;;;;;;;;;;;;;AAkBA,SAAgB,kBAAkB,OAA+B;CAC/D,MAAM,QAAQ;CAEd,MAAM,CAAC,UAAU,eAAe,aAAa,KAAK;CAClD,MAAM,SAAS,eAAe;CAE9B,MAAM,OAAO,eAAe,MAAM,IAAI;CACtC,IAAI;CAEJ,MAAM,sBAAsB,MAAM,eAAe;CAEjD,SAAS,eAAe,MAAwB;EAC9C,IAAI;GACF,IAAI,KAAK,OAAO,kBAAkB,KAAK,SAAS,GAC9C,KAAK,OAAO,sBAAsB,KAAK,SAAS;EACpD,QAAQ,CAER;CACF;CAEA,SAAS,WAAW,OAAqC,UAAU,MAAY;EAC7E,MAAM,OAAO;EACb,IAAI,CAAC,MAAM;EAEX,aAAa,KAAA;EACb,YAAY,KAAK;EACjB,IAAI,SAAS,eAAe,IAAI;EAChC,MAAM,eAAe,KAAA,GAAW,UAAU,KAAK;CACjD;CAGA,oBACS;EAAE,UAAU,MAAM;EAAU,MAAM,MAAM;EAAM,aAAa,cAAc;CAAE,KACjF,MAAM,aAAa;EAClB,IAAI,CAAC,YAAY;EACjB,IACE,CAAC,KAAK,eACL,aAAa,KAAK,aAAa,SAAS,YAAY,KAAK,SAAS,SAAS,OAE5E,WAAW;CACf,CACF;CAEA,gBAAgB,WAAW,CAAC;CAE5B,SAAS,kBAAkB,OAA4C;EACrE,IAAI,CAAC,cAAc,KAA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CAA+B;EAG/B,MAAA,KAAA,KAAAA,aAAA,MAAA,cAAA,CAAuB;EACvB,MAAA,KAAA,KAAAA,aAAA,MAAA,iBAAA,CAAmD;EAEnD,MAAA,KAAA,KAAAA,aAAA,MAAA,aAAA,CAAqB;EACrB,MAAA,KAAA,KAAAA,aAAA,MAAA,iBAAA,CAA4C;EAC5CC,UAAA,MAAA,GAAA,KAAA,CAGC;CAZW,CAAA;CAFhB,OACEX;AAoDJ"}
@@ -1,6 +1,6 @@
1
- import { cn } from "../../../lib/utils.js";
2
1
  import { insert, spread, template } from "@solidjs/web";
3
2
  import { omit } from "solid-js";
3
+ import { cn } from "../../../lib/utils.js";
4
4
  // src/components/ui/aspect-ratio/aspect-ratio.tsx
5
5
  var _tmpl$ = /* @__PURE__ */ template(`<div>`);
6
6
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"aspect-ratio.js","names":["<div\n data-slot=\"aspect-ratio\"\n style={withRatio(local.style, local.ratio ?? 16 / 9)}\n class={cn('relative w-full [&>*]:absolute [&>*]:inset-0 [&>*]:size-full', local.class)}\n {...rest}\n >\n {local.children}\n </div>"],"sources":["../../../../src/components/ui/aspect-ratio/aspect-ratio.tsx"],"sourcesContent":["import type { ComponentProps, JSX } from '@solidjs/web'\nimport { omit } from 'solid-js'\nimport { cn } from '#lib/utils'\n\n/**\n * AspectRatio.\n *\n * Holds a box to a ratio so its content cannot change the layout as it loads. The\n * problem it solves is a specific one: an image or an embed whose intrinsic size is\n * unknown until it arrives pushes everything below it down when it does, and a\n * preview or a grid of cards is where that is most visible.\n *\n * CSS `aspect-ratio` rather than the padding-top trick a decade of libraries used:\n * the property is supported everywhere this system runs, it does not require a\n * wrapper element, and it does not break when the child is positioned.\n *\n * The child fills the box, so a caller passes the image, video or iframe directly\n * and never sizes it.\n */\nexport type AspectRatioProps = ComponentProps<'div'> & {\n /** Width divided by height, e.g. `16 / 9` or `1`. */\n ratio?: number\n}\n\n/**\n * The caller's style with the ratio laid over it. A spread `style` replaces the\n * element's rather than merging, so passing any style used to drop the ratio and\n * collapse the box to zero height. `ratio` is the API for the ratio, so it wins.\n */\nfunction withRatio(style: AspectRatioProps['style'], ratio: number): JSX.CSSProperties | string {\n const value = String(ratio)\n if (typeof style === 'string') return `${style};aspect-ratio:${value}`\n return { ...style, 'aspect-ratio': value }\n}\n\nexport function AspectRatio(props: AspectRatioProps) {\n const local = props\n const rest = omit(props, 'class', 'ratio', 'style', 'children')\n\n return (\n <div\n data-slot=\"aspect-ratio\"\n style={withRatio(local.style, local.ratio ?? 16 / 9)}\n class={cn('relative w-full [&>*]:absolute [&>*]:inset-0 [&>*]:size-full', local.class)}\n {...rest}\n >\n {local.children}\n </div>\n )\n}\n"],"mappings":";;;;;;;;;;AA6BA,SAAS,UAAU,OAAkC,OAA2C;CAC9F,MAAM,QAAQ,OAAO,KAAK;CAC1B,IAAI,OAAO,UAAU,UAAU,OAAO,GAAG,MAAM,gBAAgB;CAC/D,OAAO;EAAE,GAAG;EAAO,gBAAgB;CAAM;AAC3C;AAEA,SAAgB,YAAY,OAAyB;CACnD,MAAM,QAAQ;CACd,MAAM,OAAO,KAAK,OAAO,SAAS,SAAS,SAAS,UAAU;CAG5D,IAAA,OAAA,OAOK;CAHH,OAAA,MAAA,CAAA;EAHA,aAAA;EACA,IAAA,QAAA;GAAO,OAAA,UAAU,MAAM,OAAO,MAAM,SAAS,KAAK,CAAC;EAAC;EACpD,IAAA,UAAA;GAAO,OAAA,GAAG,gEAAgE,MAAM,KAAK;EAAC;CAC9E,GAAJ,IAAA,GAAA,IAAA;CAJN,OAAA,YAME;EAAC,OAAA,MAAM;CAAQ,CACZ;CARP,OACEA;AASJ"}
1
+ {"version":3,"file":"aspect-ratio.js","names":["<div\n data-slot=\"aspect-ratio\"\n style={withRatio(local.style, local.ratio ?? 16 / 9)}\n class={cn('relative w-full [&>*]:absolute [&>*]:inset-0 [&>*]:size-full', local.class)}\n {...rest}\n >\n {local.children}\n </div>","_$spread","_$insert"],"sources":["../../../../src/components/ui/aspect-ratio/aspect-ratio.tsx"],"sourcesContent":["import type { ComponentProps, JSX } from '@solidjs/web'\nimport { omit } from 'solid-js'\nimport { cn } from '#lib/utils'\n\n/**\n * AspectRatio.\n *\n * Holds a box to a ratio so its content cannot change the layout as it loads. The\n * problem it solves is a specific one: an image or an embed whose intrinsic size is\n * unknown until it arrives pushes everything below it down when it does, and a\n * preview or a grid of cards is where that is most visible.\n *\n * CSS `aspect-ratio` rather than the padding-top trick a decade of libraries used:\n * the property is supported everywhere this system runs, it does not require a\n * wrapper element, and it does not break when the child is positioned.\n *\n * The child fills the box, so a caller passes the image, video or iframe directly\n * and never sizes it.\n */\nexport type AspectRatioProps = ComponentProps<'div'> & {\n /** Width divided by height, e.g. `16 / 9` or `1`. */\n ratio?: number\n}\n\n/**\n * The caller's style with the ratio laid over it. A spread `style` replaces the\n * element's rather than merging, so passing any style used to drop the ratio and\n * collapse the box to zero height. `ratio` is the API for the ratio, so it wins.\n */\nfunction withRatio(style: AspectRatioProps['style'], ratio: number): JSX.CSSProperties | string {\n const value = String(ratio)\n if (typeof style === 'string') return `${style};aspect-ratio:${value}`\n return { ...style, 'aspect-ratio': value }\n}\n\nexport function AspectRatio(props: AspectRatioProps) {\n const local = props\n const rest = omit(props, 'class', 'ratio', 'style', 'children')\n\n return (\n <div\n data-slot=\"aspect-ratio\"\n style={withRatio(local.style, local.ratio ?? 16 / 9)}\n class={cn('relative w-full [&>*]:absolute [&>*]:inset-0 [&>*]:size-full', local.class)}\n {...rest}\n >\n {local.children}\n </div>\n )\n}\n"],"mappings":";;;;;;;;;;AA6BA,SAAS,UAAU,OAAkC,OAA2C;CAC9F,MAAM,QAAQ,OAAO,KAAK;CAC1B,IAAI,OAAO,UAAU,UAAU,OAAO,GAAG,MAAM,gBAAgB;CAC/D,OAAO;EAAE,GAAG;EAAO,gBAAgB;CAAM;AAC3C;AAEA,SAAgB,YAAY,OAAyB;CACnD,MAAM,QAAQ;CACd,MAAM,OAAO,KAAK,OAAO,SAAS,SAAS,SAAS,UAAU;CAG5D,IAAA,OAAA,OAOK;CAHHC,OAAA,MAAA,CAAA;EAHA,aAAA;EACA,IAAA,QAAA;GAAO,OAAA,UAAU,MAAM,OAAO,MAAM,SAAS,KAAK,CAAC;EAAC;EACpD,IAAA,UAAA;GAAO,OAAA,GAAG,gEAAgE,MAAM,KAAK;EAAC;CAC9E,GAAJ,IAAA,GAAA,IAAA;CAJNC,OAAA,YAME;EAAC,OAAA,MAAM;CAAQ,CACZ;CARP,OACEF;AASJ"}
@@ -1,11 +1,11 @@
1
+ import { claimElement, className, createComponent, delegateEvents, effect, getOwner, insert, memo, readShallow, setAttribute, spread, template } from "@solidjs/web";
2
+ import { Archive as Archive$1, File, FileCode as FileCode$1, FileText as FileText$1, Image, LoaderCircle as LoaderCircle$1, TriangleAlert as TriangleAlert$1, X as X$1 } from "@lucide/solid";
3
+ import { omit } from "solid-js";
1
4
  import { formatByteSize } from "../../../lib/bytes.js";
2
5
  import { FETCH_SCHEMES, urlWithScheme } from "../../../lib/url.js";
3
6
  import { cn } from "../../../lib/utils.js";
4
7
  import { Button } from "../button/button.js";
5
8
  import { fastIcon } from "../../../lib/fast-icon.js";
6
- import { claimElement, className, createComponent, delegateEvents, effect, getOwner, insert, memo, readShallow, setAttribute, spread, template } from "@solidjs/web";
7
- import { Archive, File, FileCode, FileText, Image, LoaderCircle, TriangleAlert, X } from "@lucide/solid";
8
- import { omit } from "solid-js";
9
9
  // src/components/ui/attachment/attachment.tsx
10
10
  var _tmpl$ = /* @__PURE__ */ template(`<span class="min-w-0 truncate font-medium">`);
11
11
  var _tmpl$2 = /* @__PURE__ */ template(`<a target=_blank rel="noreferrer noopener"class="min-w-0 truncate rounded-xs font-medium outline-none hover:underline focus-visible:ring-3 focus-visible:ring-primary-subtle">`);
@@ -17,20 +17,20 @@ var _tmpl$7 = /* @__PURE__ */ template(`<span class="flex min-w-0 items-center g
17
17
  var _tmpl$8 = /* @__PURE__ */ template(`<span class="flex min-w-0 flex-1 items-center gap-2"><!><!>`);
18
18
  var _tmpl$9 = /* @__PURE__ */ template(`<img alt class="size-full object-cover">`);
19
19
  var _tmpl$10 = /* @__PURE__ */ template(`<ul>`);
20
- var Archive$1 = fastIcon(Archive);
20
+ var Archive = fastIcon(Archive$1);
21
21
  var FileIcon = fastIcon(File);
22
- var FileCode$1 = fastIcon(FileCode);
23
- var FileText$1 = fastIcon(FileText);
22
+ var FileCode = fastIcon(FileCode$1);
23
+ var FileText = fastIcon(FileText$1);
24
24
  var ImageIcon = fastIcon(Image);
25
- var LoaderCircle$1 = fastIcon(LoaderCircle);
26
- var TriangleAlert$1 = fastIcon(TriangleAlert);
27
- var X$1 = fastIcon(X);
25
+ var LoaderCircle = fastIcon(LoaderCircle$1);
26
+ var TriangleAlert = fastIcon(TriangleAlert$1);
27
+ var X = fastIcon(X$1);
28
28
  var KIND_ICON = {
29
29
  image: ImageIcon,
30
- document: FileText$1,
31
- code: FileCode$1,
32
- text: FileText$1,
33
- archive: Archive$1,
30
+ document: FileText,
31
+ code: FileCode,
32
+ text: FileText,
33
+ archive: Archive,
34
34
  other: FileIcon
35
35
  };
36
36
  /** The figure as written: whole numbers from 10 up, one decimal below. */
@@ -62,11 +62,11 @@ function Attachment(props) {
62
62
  const size = () => formatAttachmentSize(local.size);
63
63
  const actionable = () => status() === "ready" || status() === "error";
64
64
  const mark = () => {
65
- if (status() === "uploading") return createComponent(LoaderCircle$1, {
65
+ if (status() === "uploading") return createComponent(LoaderCircle, {
66
66
  "aria-hidden": "true",
67
67
  class: "motion-safe:animate-spin"
68
68
  });
69
- if (status() === "error") return createComponent(TriangleAlert$1, { "aria-hidden": "true" });
69
+ if (status() === "error") return createComponent(TriangleAlert, { "aria-hidden": "true" });
70
70
  const Glyph = Icon();
71
71
  return createComponent(Glyph, { "aria-hidden": "true" });
72
72
  };
@@ -163,7 +163,7 @@ function Attachment(props) {
163
163
  },
164
164
  onClick: () => local.onRemove?.(),
165
165
  get children() {
166
- return createComponent(X$1, { "aria-hidden": "true" });
166
+ return createComponent(X, { "aria-hidden": "true" });
167
167
  }
168
168
  }) : void 0;
169
169
  });
@@ -1 +1 @@
1
- {"version":3,"file":"attachment.js","names":["<LoaderCircle aria-hidden=\"true\" class=\"motion-safe:animate-spin\" />","class=\"motion-safe:animate-spin\"","<TriangleAlert aria-hidden=\"true\" />","<Glyph aria-hidden=\"true\" />","<Show\n when={actionable() && (local.href !== undefined || local.onOpen !== undefined)}\n fallback={label()}\n >\n <Show\n when={local.href !== undefined}\n fallback={\n <button\n type=\"button\"\n class=\"min-w-0 truncate rounded-xs text-start font-medium outline-none hover:underline focus-visible:ring-3 focus-visible:ring-primary-subtle\"\n title={local.name}\n onClick={() => local.onOpen?.()}\n >\n {local.name}\n </button>\n }\n >\n <a\n href={local.href}\n target=\"_blank\"\n rel=\"noreferrer noopener\"\n class=\"min-w-0 truncate rounded-xs font-medium outline-none hover:underline focus-visible:ring-3 focus-visible:ring-primary-subtle\"\n title={local.name}\n >\n {local.name}\n </a>\n </Show>\n </Show>","<Show\n when={local.href !== undefined}\n fallback={\n <button\n type=\"button\"\n class=\"min-w-0 truncate rounded-xs text-start font-medium outline-none hover:underline focus-visible:ring-3 focus-visible:ring-primary-subtle\"\n title={local.name}\n onClick={() => local.onOpen?.()}\n >\n {local.name}\n </button>\n }\n >\n <a\n href={local.href}\n target=\"_blank\"\n rel=\"noreferrer noopener\"\n class=\"min-w-0 truncate rounded-xs font-medium outline-none hover:underline focus-visible:ring-3 focus-visible:ring-primary-subtle\"\n title={local.name}\n >\n {local.name}\n </a>\n </Show>","title={local.name}","<Show when={status() !== 'ready' || size()}>\n <span\n class={cn('shrink-0 text-xs', {\n 'text-destructive': status() === 'error',\n 'text-muted-foreground': status() !== 'error',\n })}\n role={status() === 'uploading' || status() === 'error' ? 'status' : undefined}\n >\n {status() === 'uploading'\n ? local.progress === undefined\n ? 'Uploading…'\n : `Uploading ${Math.round(local.progress)}%`\n : status() === 'error'\n ? (local.statusLabel ?? 'Could not attach')\n : status() === 'unavailable'\n ? (local.statusLabel ?? 'Unavailable')\n : size()}\n </span>\n </Show>","{status() === 'uploading'\n ? local.progress === undefined\n ? 'Uploading…'\n : `Uploading ${Math.round(local.progress)}%`\n : status() === 'error'\n ? (local.statusLabel ?? 'Could not attach')\n : status() === 'unavailable'\n ? (local.statusLabel ?? 'Unavailable')\n : size()}","role={status() === 'uploading' || status() === 'error' ? 'status' : undefined}","<Show when={local.onRemove}>\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"icon-2xs\"\n class=\"shrink-0\"\n aria-label={local.removeLabel ?? `Remove ${local.name}`}\n onClick={() => local.onRemove?.()}\n >\n <X aria-hidden=\"true\" />\n </Button>\n </Show>","<Button\n type=\"button\"\n variant=\"ghost\"\n size=\"icon-2xs\"\n class=\"shrink-0\"\n aria-label={local.removeLabel ?? `Remove ${local.name}`}\n onClick={() => local.onRemove?.()}\n >\n <X aria-hidden=\"true\" />\n </Button>","type=\"button\"","variant=\"ghost\"","size=\"icon-2xs\"","class=\"shrink-0\"","onClick={() => local.onRemove?.()}","<X aria-hidden=\"true\" />","<span class=\"flex min-w-0 items-center gap-1\">\n {name()}\n {remove()}\n </span>","{detail()}","<span class=\"flex min-w-0 flex-1 items-center gap-2\">\n {name()}\n {detail()}\n </span>","{remove()}","<div\n data-slot=\"attachment\"\n data-variant={variant()}\n data-status={status()}\n class={cn(\n 'min-w-0 text-sm',\n {\n 'inline-flex max-w-full items-center gap-1.5 rounded-lg border border-border bg-card py-1 ps-2 pe-1':\n variant() === 'chip',\n 'flex w-full max-w-sm items-center gap-2.5 rounded-xl border border-border bg-card p-2':\n variant() === 'card',\n 'flex w-32 flex-col gap-1.5': variant() === 'tile',\n 'border-destructive': status() === 'error',\n 'opacity-70': status() === 'unavailable',\n },\n local.class\n )}\n {...rest}\n >\n <Show\n when={variant() === 'tile'}\n fallback={\n <>\n <span\n class={cn('grid shrink-0 place-items-center text-muted-foreground [&_svg]:size-4', {\n 'size-9 overflow-hidden rounded-lg bg-muted': variant() === 'card',\n 'text-destructive': status() === 'error',\n })}\n >\n <Show when={preview() && variant() === 'card'} fallback={mark()}>\n <img src={preview()} alt=\"\" class=\"size-full object-cover\" />\n </Show>\n </span>\n <span class=\"flex min-w-0 flex-1 items-center gap-2\">\n {name()}\n {detail()}\n </span>\n {remove()}\n </>\n }\n >\n <span class=\"relative grid aspect-square w-full place-items-center overflow-hidden rounded-xl border border-border bg-muted text-muted-foreground [&_svg]:size-6\">\n <Show when={preview()} fallback={mark()}>\n <img src={preview()} alt=\"\" class=\"size-full object-cover\" />\n </Show>\n </span>\n <span class=\"flex min-w-0 items-center gap-1\">\n {name()}\n {remove()}\n </span>\n {detail()}\n </Show>\n </div>","role=\"list\"","<ul\n role=\"list\"\n data-slot=\"attachment-list\"\n class={cn('m-0 flex min-w-0 list-none flex-wrap gap-2 p-0', local.class)}\n {...rest}\n >\n {local.children}\n </ul>","Archive","LucideArchive","LucideFileIcon","FileCode","LucideFileCode","FileText","LucideFileText","LucideImageIcon","LoaderCircle","LucideLoaderCircle","TriangleAlert","LucideTriangleAlert","X","LucideX","_$setAttribute","_$readShallow"],"sources":["../../../../src/components/ui/attachment/attachment.tsx"],"sourcesContent":["import {\n Archive as LucideArchive,\n File as LucideFileIcon,\n FileCode as LucideFileCode,\n FileText as LucideFileText,\n Image as LucideImageIcon,\n LoaderCircle as LucideLoaderCircle,\n TriangleAlert as LucideTriangleAlert,\n X as LucideX,\n} from '@lucide/solid'\nimport { Show, omit } from 'solid-js'\nimport { type ComponentProps, type JSX } from '@solidjs/web'\nimport { formatByteSize } from '#lib/bytes'\nimport { FETCH_SCHEMES, urlWithScheme } from '#lib/url'\nimport { cn } from '#lib/utils'\nimport { Button } from '../button'\nimport { fastIcon } from '#lib/fast-icon'\n\n// lucide icons drawn from a cloned template (see fastIcon).\nconst Archive = fastIcon(LucideArchive)\nconst FileIcon = fastIcon(LucideFileIcon)\nconst FileCode = fastIcon(LucideFileCode)\nconst FileText = fastIcon(LucideFileText)\nconst ImageIcon = fastIcon(LucideImageIcon)\nconst LoaderCircle = fastIcon(LucideLoaderCircle)\nconst TriangleAlert = fastIcon(LucideTriangleAlert)\nconst X = fastIcon(LucideX)\n\n/**\n * Attachment.\n *\n * A file that travels with a message or sits in the composer. Three\n * presentations of one thing: a `chip` (a line, for the composer and for a list\n * of many), a `card` (name, type and size, for a message's attachments), and a\n * `tile` (a preview image with the name beneath, for pictures).\n *\n * ## It only offers what works\n *\n * An attachment is a *claim that a file exists and can be handled*. This\n * component therefore draws an action only when the caller supplied the\n * handler: no `onOpen`/`href` and the name is plain text, not a dead button; no\n * `onRemove` and there is no ✕. A host whose attachments cannot be reopened (a\n * name the runtime echoed back, a file that was never stored) renders honest,\n * static chips instead of controls that do nothing.\n *\n * ## Untrusted metadata\n *\n * Name, type and size come from whoever sent the file. They are rendered as\n * text, the name is never used as a path or URL, and a preview is shown only\n * for `blob:`, `https:`/`http:` or a `data:image/*` raster source (no SVG, which\n * can carry script when opened on its own).\n *\n * `status` states the truth about the file's lifecycle in words (`uploading`,\n * `error`, `unavailable`), not by colour alone.\n */\nexport type AttachmentKind = 'image' | 'document' | 'code' | 'text' | 'archive' | 'other'\nexport type AttachmentStatus = 'ready' | 'uploading' | 'error' | 'unavailable'\nexport type AttachmentVariant = 'chip' | 'card' | 'tile'\n\nconst KIND_ICON = {\n image: ImageIcon,\n document: FileText,\n code: FileCode,\n text: FileText,\n archive: Archive,\n other: FileIcon,\n} as const\n\n/** The figure as written: whole numbers from 10 up, one decimal below. */\nconst shown = (amount: number) => (amount >= 10 ? Math.round(amount) : Math.round(amount * 10) / 10)\n\n/** `1536` → `1.5 KB`. Returns nothing for a value that is not a finite size. */\nexport function formatAttachmentSize(bytes: number | undefined): string | undefined {\n if (bytes === undefined || !Number.isFinite(bytes) || bytes < 0) return undefined\n return formatByteSize(bytes, ['KB', 'MB', 'GB', 'TB'], (value) => String(shown(value)))\n}\n\n/** The only sources a preview may use. */\nexport function safePreviewSrc(value: string | undefined): string | undefined {\n if (!value) return undefined\n if (value.startsWith('blob:')) return value\n if (/^data:image\\/(?:png|jpe?g|gif|webp|avif);base64,[A-Za-z0-9+/=]+$/.test(value)) return value\n return urlWithScheme(value, FETCH_SCHEMES) ? value : undefined\n}\n\nexport type AttachmentProps = Omit<ComponentProps<'div'>, 'children'> & {\n name: string\n kind?: AttachmentKind\n /** Bytes. */\n size?: number\n variant?: AttachmentVariant\n status?: AttachmentStatus\n /** 0–100 while `uploading`; omit for indeterminate. */\n progress?: number\n /** Why it failed or is unavailable, in words. */\n statusLabel?: string\n previewSrc?: string\n /** Open the file in the host. Omit and the name is not a control. */\n onOpen?: () => void\n /** Open the file by address. Omit and the name is not a link. */\n href?: string\n /** Detach it. Omit and there is no remove control. */\n onRemove?: () => void\n removeLabel?: string\n}\n\nexport function Attachment(props: AttachmentProps) {\n const local = props\n const rest = omit(\n props,\n 'class',\n 'name',\n 'kind',\n 'size',\n 'variant',\n 'status',\n 'progress',\n 'statusLabel',\n 'previewSrc',\n 'onOpen',\n 'href',\n 'onRemove',\n 'removeLabel'\n )\n const variant = () => local.variant ?? 'chip'\n const status = () => local.status ?? 'ready'\n const preview = () => (local.kind === 'image' ? safePreviewSrc(local.previewSrc) : undefined)\n const Icon = () => KIND_ICON[local.kind ?? 'other']\n const size = () => formatAttachmentSize(local.size)\n const actionable = () => status() === 'ready' || status() === 'error'\n\n const mark = (): JSX.Element => {\n if (status() === 'uploading')\n return <LoaderCircle aria-hidden=\"true\" class=\"motion-safe:animate-spin\" />\n if (status() === 'error') return <TriangleAlert aria-hidden=\"true\" />\n const Glyph = Icon()\n return <Glyph aria-hidden=\"true\" />\n }\n\n const label = (): JSX.Element => (\n <span class=\"min-w-0 truncate font-medium\" title={local.name}>\n {local.name}\n </span>\n )\n\n const name = (): JSX.Element => (\n <Show\n when={actionable() && (local.href !== undefined || local.onOpen !== undefined)}\n fallback={label()}\n >\n <Show\n when={local.href !== undefined}\n fallback={\n <button\n type=\"button\"\n class=\"min-w-0 truncate rounded-xs text-start font-medium outline-none hover:underline focus-visible:ring-3 focus-visible:ring-primary-subtle\"\n title={local.name}\n onClick={() => local.onOpen?.()}\n >\n {local.name}\n </button>\n }\n >\n <a\n href={local.href}\n target=\"_blank\"\n rel=\"noreferrer noopener\"\n class=\"min-w-0 truncate rounded-xs font-medium outline-none hover:underline focus-visible:ring-3 focus-visible:ring-primary-subtle\"\n title={local.name}\n >\n {local.name}\n </a>\n </Show>\n </Show>\n )\n\n const detail = (): JSX.Element => (\n <Show when={status() !== 'ready' || size()}>\n <span\n class={cn('shrink-0 text-xs', {\n 'text-destructive': status() === 'error',\n 'text-muted-foreground': status() !== 'error',\n })}\n role={status() === 'uploading' || status() === 'error' ? 'status' : undefined}\n >\n {status() === 'uploading'\n ? local.progress === undefined\n ? 'Uploading…'\n : `Uploading ${Math.round(local.progress)}%`\n : status() === 'error'\n ? (local.statusLabel ?? 'Could not attach')\n : status() === 'unavailable'\n ? (local.statusLabel ?? 'Unavailable')\n : size()}\n </span>\n </Show>\n )\n\n const remove = (): JSX.Element => (\n <Show when={local.onRemove}>\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"icon-2xs\"\n class=\"shrink-0\"\n aria-label={local.removeLabel ?? `Remove ${local.name}`}\n onClick={() => local.onRemove?.()}\n >\n <X aria-hidden=\"true\" />\n </Button>\n </Show>\n )\n\n return (\n <div\n data-slot=\"attachment\"\n data-variant={variant()}\n data-status={status()}\n class={cn(\n 'min-w-0 text-sm',\n {\n 'inline-flex max-w-full items-center gap-1.5 rounded-lg border border-border bg-card py-1 ps-2 pe-1':\n variant() === 'chip',\n 'flex w-full max-w-sm items-center gap-2.5 rounded-xl border border-border bg-card p-2':\n variant() === 'card',\n 'flex w-32 flex-col gap-1.5': variant() === 'tile',\n 'border-destructive': status() === 'error',\n 'opacity-70': status() === 'unavailable',\n },\n local.class\n )}\n {...rest}\n >\n <Show\n when={variant() === 'tile'}\n fallback={\n <>\n <span\n class={cn('grid shrink-0 place-items-center text-muted-foreground [&_svg]:size-4', {\n 'size-9 overflow-hidden rounded-lg bg-muted': variant() === 'card',\n 'text-destructive': status() === 'error',\n })}\n >\n <Show when={preview() && variant() === 'card'} fallback={mark()}>\n <img src={preview()} alt=\"\" class=\"size-full object-cover\" />\n </Show>\n </span>\n <span class=\"flex min-w-0 flex-1 items-center gap-2\">\n {name()}\n {detail()}\n </span>\n {remove()}\n </>\n }\n >\n <span class=\"relative grid aspect-square w-full place-items-center overflow-hidden rounded-xl border border-border bg-muted text-muted-foreground [&_svg]:size-6\">\n <Show when={preview()} fallback={mark()}>\n <img src={preview()} alt=\"\" class=\"size-full object-cover\" />\n </Show>\n </span>\n <span class=\"flex min-w-0 items-center gap-1\">\n {name()}\n {remove()}\n </span>\n {detail()}\n </Show>\n </div>\n )\n}\n\nexport function AttachmentList(props: ComponentProps<'ul'>) {\n const local = props\n const rest = omit(props, 'class', 'children')\n return (\n <ul\n role=\"list\"\n data-slot=\"attachment-list\"\n class={cn('m-0 flex min-w-0 list-none flex-wrap gap-2 p-0', local.class)}\n {...rest}\n >\n {local.children}\n </ul>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAmBA,IAAMyB,YAAU,SAASC,OAAa;AACtC,IAAM,WAAW,SAASC,IAAc;AACxC,IAAMC,aAAW,SAASC,QAAc;AACxC,IAAMC,aAAW,SAASC,QAAc;AACxC,IAAM,YAAY,SAASC,KAAe;AAC1C,IAAMC,iBAAe,SAASC,YAAkB;AAChD,IAAMC,kBAAgB,SAASC,aAAmB;AAClD,IAAMC,MAAI,SAASC,CAAO;AAiC1B,IAAM,YAAY;CAChB,OAAO;CACP,UAAUR;CACV,MAAMF;CACN,MAAME;CACN,SAASL;CACT,OAAO;AACT;;AAGA,IAAM,SAAS,WAAoB,UAAU,KAAK,KAAK,MAAM,MAAM,IAAI,KAAK,MAAM,SAAS,EAAE,IAAI;;AAGjG,SAAgB,qBAAqB,OAA+C;CAClF,IAAI,U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A4BC;CAAC,EAAA,CAAD,CACH;CArDP,OACEC;AAsDJ;AAEA,SAAgB,eAAe,OAA6B;CAC1D,MAAM,QAAQ;CACd,MAAM,OAAO,KAAK,OAAO,SAAS,UAAU;CAE1C,IAAA,SAAA,SAOI;CAHF,OAAA,QAAA,CAAA;EAHAC,MAAAA;EACA,aAAA;EACA,IAAA,UAAA;GAAO,OAAA,GAAG,kDAAkD,MAAM,KAAK;EAAC;CAChE,GAAJ,IAAA,GAAA,IAAA;CAJN,OAAA,cAME;EAAC,OAAA,MAAM;CAAQ,CACb;CARN,OACEC;AASJ"}
1
+ {"version":3,"file":"attachment.js","names":["<LoaderCircle aria-hidden=\"true\" class=\"motion-safe:animate-spin\" />","class=\"motion-safe:animate-spin\"","<TriangleAlert aria-hidden=\"true\" />","<Glyph aria-hidden=\"true\" />","<Show\n when={actionable() && (local.href !== undefined || local.onOpen !== undefined)}\n fallback={label()}\n >\n <Show\n when={local.href !== undefined}\n fallback={\n <button\n type=\"button\"\n class=\"min-w-0 truncate rounded-xs text-start font-medium outline-none hover:underline focus-visible:ring-3 focus-visible:ring-primary-subtle\"\n title={local.name}\n onClick={() => local.onOpen?.()}\n >\n {local.name}\n </button>\n }\n >\n <a\n href={local.href}\n target=\"_blank\"\n rel=\"noreferrer noopener\"\n class=\"min-w-0 truncate rounded-xs font-medium outline-none hover:underline focus-visible:ring-3 focus-visible:ring-primary-subtle\"\n title={local.name}\n >\n {local.name}\n </a>\n </Show>\n </Show>","<Show\n when={local.href !== undefined}\n fallback={\n <button\n type=\"button\"\n class=\"min-w-0 truncate rounded-xs text-start font-medium outline-none hover:underline focus-visible:ring-3 focus-visible:ring-primary-subtle\"\n title={local.name}\n onClick={() => local.onOpen?.()}\n >\n {local.name}\n </button>\n }\n >\n <a\n href={local.href}\n target=\"_blank\"\n rel=\"noreferrer noopener\"\n class=\"min-w-0 truncate rounded-xs font-medium outline-none hover:underline focus-visible:ring-3 focus-visible:ring-primary-subtle\"\n title={local.name}\n >\n {local.name}\n </a>\n </Show>","title={local.name}","<Show when={status() !== 'ready' || size()}>\n <span\n class={cn('shrink-0 text-xs', {\n 'text-destructive': status() === 'error',\n 'text-muted-foreground': status() !== 'error',\n })}\n role={status() === 'uploading' || status() === 'error' ? 'status' : undefined}\n >\n {status() === 'uploading'\n ? local.progress === undefined\n ? 'Uploading…'\n : `Uploading ${Math.round(local.progress)}%`\n : status() === 'error'\n ? (local.statusLabel ?? 'Could not attach')\n : status() === 'unavailable'\n ? (local.statusLabel ?? 'Unavailable')\n : size()}\n </span>\n </Show>","{status() === 'uploading'\n ? local.progress === undefined\n ? 'Uploading…'\n : `Uploading ${Math.round(local.progress)}%`\n : status() === 'error'\n ? (local.statusLabel ?? 'Could not attach')\n : status() === 'unavailable'\n ? (local.statusLabel ?? 'Unavailable')\n : size()}","role={status() === 'uploading' || status() === 'error' ? 'status' : undefined}","<Show when={local.onRemove}>\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"icon-2xs\"\n class=\"shrink-0\"\n aria-label={local.removeLabel ?? `Remove ${local.name}`}\n onClick={() => local.onRemove?.()}\n >\n <X aria-hidden=\"true\" />\n </Button>\n </Show>","<Button\n type=\"button\"\n variant=\"ghost\"\n size=\"icon-2xs\"\n class=\"shrink-0\"\n aria-label={local.removeLabel ?? `Remove ${local.name}`}\n onClick={() => local.onRemove?.()}\n >\n <X aria-hidden=\"true\" />\n </Button>","type=\"button\"","variant=\"ghost\"","size=\"icon-2xs\"","class=\"shrink-0\"","onClick={() => local.onRemove?.()}","<X aria-hidden=\"true\" />","<span class=\"flex min-w-0 items-center gap-1\">\n {name()}\n {remove()}\n </span>","{detail()}","<span class=\"flex min-w-0 flex-1 items-center gap-2\">\n {name()}\n {detail()}\n </span>","{remove()}","<div\n data-slot=\"attachment\"\n data-variant={variant()}\n data-status={status()}\n class={cn(\n 'min-w-0 text-sm',\n {\n 'inline-flex max-w-full items-center gap-1.5 rounded-lg border border-border bg-card py-1 ps-2 pe-1':\n variant() === 'chip',\n 'flex w-full max-w-sm items-center gap-2.5 rounded-xl border border-border bg-card p-2':\n variant() === 'card',\n 'flex w-32 flex-col gap-1.5': variant() === 'tile',\n 'border-destructive': status() === 'error',\n 'opacity-70': status() === 'unavailable',\n },\n local.class\n )}\n {...rest}\n >\n <Show\n when={variant() === 'tile'}\n fallback={\n <>\n <span\n class={cn('grid shrink-0 place-items-center text-muted-foreground [&_svg]:size-4', {\n 'size-9 overflow-hidden rounded-lg bg-muted': variant() === 'card',\n 'text-destructive': status() === 'error',\n })}\n >\n <Show when={preview() && variant() === 'card'} fallback={mark()}>\n <img src={preview()} alt=\"\" class=\"size-full object-cover\" />\n </Show>\n </span>\n <span class=\"flex min-w-0 flex-1 items-center gap-2\">\n {name()}\n {detail()}\n </span>\n {remove()}\n </>\n }\n >\n <span class=\"relative grid aspect-square w-full place-items-center overflow-hidden rounded-xl border border-border bg-muted text-muted-foreground [&_svg]:size-6\">\n <Show when={preview()} fallback={mark()}>\n <img src={preview()} alt=\"\" class=\"size-full object-cover\" />\n </Show>\n </span>\n <span class=\"flex min-w-0 items-center gap-1\">\n {name()}\n {remove()}\n </span>\n {detail()}\n </Show>\n </div>","role=\"list\"","<ul\n role=\"list\"\n data-slot=\"attachment-list\"\n class={cn('m-0 flex min-w-0 list-none flex-wrap gap-2 p-0', local.class)}\n {...rest}\n >\n {local.children}\n </ul>","LucideArchive","LucideFileIcon","LucideFileCode","LucideFileText","LucideImageIcon","LucideLoaderCircle","LucideTriangleAlert","LucideX","_$insert","_$effect","_$setAttribute","_$readShallow","_$className","_$spread"],"sources":["../../../../src/components/ui/attachment/attachment.tsx"],"sourcesContent":["import {\n Archive as LucideArchive,\n File as LucideFileIcon,\n FileCode as LucideFileCode,\n FileText as LucideFileText,\n Image as LucideImageIcon,\n LoaderCircle as LucideLoaderCircle,\n TriangleAlert as LucideTriangleAlert,\n X as LucideX,\n} from '@lucide/solid'\nimport { Show, omit } from 'solid-js'\nimport { type ComponentProps, type JSX } from '@solidjs/web'\nimport { formatByteSize } from '#lib/bytes'\nimport { FETCH_SCHEMES, urlWithScheme } from '#lib/url'\nimport { cn } from '#lib/utils'\nimport { Button } from '../button'\nimport { fastIcon } from '#lib/fast-icon'\n\n// lucide icons drawn from a cloned template (see fastIcon).\nconst Archive = fastIcon(LucideArchive)\nconst FileIcon = fastIcon(LucideFileIcon)\nconst FileCode = fastIcon(LucideFileCode)\nconst FileText = fastIcon(LucideFileText)\nconst ImageIcon = fastIcon(LucideImageIcon)\nconst LoaderCircle = fastIcon(LucideLoaderCircle)\nconst TriangleAlert = fastIcon(LucideTriangleAlert)\nconst X = fastIcon(LucideX)\n\n/**\n * Attachment.\n *\n * A file that travels with a message or sits in the composer. Three\n * presentations of one thing: a `chip` (a line, for the composer and for a list\n * of many), a `card` (name, type and size, for a message's attachments), and a\n * `tile` (a preview image with the name beneath, for pictures).\n *\n * ## It only offers what works\n *\n * An attachment is a *claim that a file exists and can be handled*. This\n * component therefore draws an action only when the caller supplied the\n * handler: no `onOpen`/`href` and the name is plain text, not a dead button; no\n * `onRemove` and there is no ✕. A host whose attachments cannot be reopened (a\n * name the runtime echoed back, a file that was never stored) renders honest,\n * static chips instead of controls that do nothing.\n *\n * ## Untrusted metadata\n *\n * Name, type and size come from whoever sent the file. They are rendered as\n * text, the name is never used as a path or URL, and a preview is shown only\n * for `blob:`, `https:`/`http:` or a `data:image/*` raster source (no SVG, which\n * can carry script when opened on its own).\n *\n * `status` states the truth about the file's lifecycle in words (`uploading`,\n * `error`, `unavailable`), not by colour alone.\n */\nexport type AttachmentKind = 'image' | 'document' | 'code' | 'text' | 'archive' | 'other'\nexport type AttachmentStatus = 'ready' | 'uploading' | 'error' | 'unavailable'\nexport type AttachmentVariant = 'chip' | 'card' | 'tile'\n\nconst KIND_ICON = {\n image: ImageIcon,\n document: FileText,\n code: FileCode,\n text: FileText,\n archive: Archive,\n other: FileIcon,\n} as const\n\n/** The figure as written: whole numbers from 10 up, one decimal below. */\nconst shown = (amount: number) => (amount >= 10 ? Math.round(amount) : Math.round(amount * 10) / 10)\n\n/** `1536` → `1.5 KB`. Returns nothing for a value that is not a finite size. */\nexport function formatAttachmentSize(bytes: number | undefined): string | undefined {\n if (bytes === undefined || !Number.isFinite(bytes) || bytes < 0) return undefined\n return formatByteSize(bytes, ['KB', 'MB', 'GB', 'TB'], (value) => String(shown(value)))\n}\n\n/** The only sources a preview may use. */\nexport function safePreviewSrc(value: string | undefined): string | undefined {\n if (!value) return undefined\n if (value.startsWith('blob:')) return value\n if (/^data:image\\/(?:png|jpe?g|gif|webp|avif);base64,[A-Za-z0-9+/=]+$/.test(value)) return value\n return urlWithScheme(value, FETCH_SCHEMES) ? value : undefined\n}\n\nexport type AttachmentProps = Omit<ComponentProps<'div'>, 'children'> & {\n name: string\n kind?: AttachmentKind\n /** Bytes. */\n size?: number\n variant?: AttachmentVariant\n status?: AttachmentStatus\n /** 0–100 while `uploading`; omit for indeterminate. */\n progress?: number\n /** Why it failed or is unavailable, in words. */\n statusLabel?: string\n previewSrc?: string\n /** Open the file in the host. Omit and the name is not a control. */\n onOpen?: () => void\n /** Open the file by address. Omit and the name is not a link. */\n href?: string\n /** Detach it. Omit and there is no remove control. */\n onRemove?: () => void\n removeLabel?: string\n}\n\nexport function Attachment(props: AttachmentProps) {\n const local = props\n const rest = omit(\n props,\n 'class',\n 'name',\n 'kind',\n 'size',\n 'variant',\n 'status',\n 'progress',\n 'statusLabel',\n 'previewSrc',\n 'onOpen',\n 'href',\n 'onRemove',\n 'removeLabel'\n )\n const variant = () => local.variant ?? 'chip'\n const status = () => local.status ?? 'ready'\n const preview = () => (local.kind === 'image' ? safePreviewSrc(local.previewSrc) : undefined)\n const Icon = () => KIND_ICON[local.kind ?? 'other']\n const size = () => formatAttachmentSize(local.size)\n const actionable = () => status() === 'ready' || status() === 'error'\n\n const mark = (): JSX.Element => {\n if (status() === 'uploading')\n return <LoaderCircle aria-hidden=\"true\" class=\"motion-safe:animate-spin\" />\n if (status() === 'error') return <TriangleAlert aria-hidden=\"true\" />\n const Glyph = Icon()\n return <Glyph aria-hidden=\"true\" />\n }\n\n const label = (): JSX.Element => (\n <span class=\"min-w-0 truncate font-medium\" title={local.name}>\n {local.name}\n </span>\n )\n\n const name = (): JSX.Element => (\n <Show\n when={actionable() && (local.href !== undefined || local.onOpen !== undefined)}\n fallback={label()}\n >\n <Show\n when={local.href !== undefined}\n fallback={\n <button\n type=\"button\"\n class=\"min-w-0 truncate rounded-xs text-start font-medium outline-none hover:underline focus-visible:ring-3 focus-visible:ring-primary-subtle\"\n title={local.name}\n onClick={() => local.onOpen?.()}\n >\n {local.name}\n </button>\n }\n >\n <a\n href={local.href}\n target=\"_blank\"\n rel=\"noreferrer noopener\"\n class=\"min-w-0 truncate rounded-xs font-medium outline-none hover:underline focus-visible:ring-3 focus-visible:ring-primary-subtle\"\n title={local.name}\n >\n {local.name}\n </a>\n </Show>\n </Show>\n )\n\n const detail = (): JSX.Element => (\n <Show when={status() !== 'ready' || size()}>\n <span\n class={cn('shrink-0 text-xs', {\n 'text-destructive': status() === 'error',\n 'text-muted-foreground': status() !== 'error',\n })}\n role={status() === 'uploading' || status() === 'error' ? 'status' : undefined}\n >\n {status() === 'uploading'\n ? local.progress === undefined\n ? 'Uploading…'\n : `Uploading ${Math.round(local.progress)}%`\n : status() === 'error'\n ? (local.statusLabel ?? 'Could not attach')\n : status() === 'unavailable'\n ? (local.statusLabel ?? 'Unavailable')\n : size()}\n </span>\n </Show>\n )\n\n const remove = (): JSX.Element => (\n <Show when={local.onRemove}>\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"icon-2xs\"\n class=\"shrink-0\"\n aria-label={local.removeLabel ?? `Remove ${local.name}`}\n onClick={() => local.onRemove?.()}\n >\n <X aria-hidden=\"true\" />\n </Button>\n </Show>\n )\n\n return (\n <div\n data-slot=\"attachment\"\n data-variant={variant()}\n data-status={status()}\n class={cn(\n 'min-w-0 text-sm',\n {\n 'inline-flex max-w-full items-center gap-1.5 rounded-lg border border-border bg-card py-1 ps-2 pe-1':\n variant() === 'chip',\n 'flex w-full max-w-sm items-center gap-2.5 rounded-xl border border-border bg-card p-2':\n variant() === 'card',\n 'flex w-32 flex-col gap-1.5': variant() === 'tile',\n 'border-destructive': status() === 'error',\n 'opacity-70': status() === 'unavailable',\n },\n local.class\n )}\n {...rest}\n >\n <Show\n when={variant() === 'tile'}\n fallback={\n <>\n <span\n class={cn('grid shrink-0 place-items-center text-muted-foreground [&_svg]:size-4', {\n 'size-9 overflow-hidden rounded-lg bg-muted': variant() === 'card',\n 'text-destructive': status() === 'error',\n })}\n >\n <Show when={preview() && variant() === 'card'} fallback={mark()}>\n <img src={preview()} alt=\"\" class=\"size-full object-cover\" />\n </Show>\n </span>\n <span class=\"flex min-w-0 flex-1 items-center gap-2\">\n {name()}\n {detail()}\n </span>\n {remove()}\n </>\n }\n >\n <span class=\"relative grid aspect-square w-full place-items-center overflow-hidden rounded-xl border border-border bg-muted text-muted-foreground [&_svg]:size-6\">\n <Show when={preview()} fallback={mark()}>\n <img src={preview()} alt=\"\" class=\"size-full object-cover\" />\n </Show>\n </span>\n <span class=\"flex min-w-0 items-center gap-1\">\n {name()}\n {remove()}\n </span>\n {detail()}\n </Show>\n </div>\n )\n}\n\nexport function AttachmentList(props: ComponentProps<'ul'>) {\n const local = props\n const rest = omit(props, 'class', 'children')\n return (\n <ul\n role=\"list\"\n data-slot=\"attachment-list\"\n class={cn('m-0 flex min-w-0 list-none flex-wrap gap-2 p-0', local.class)}\n {...rest}\n >\n {local.children}\n </ul>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAmBA,IAAM,UAAU,SAASyB,SAAa;AACtC,IAAM,WAAW,SAASC,IAAc;AACxC,IAAM,WAAW,SAASC,UAAc;AACxC,IAAM,WAAW,SAASC,UAAc;AACxC,IAAM,YAAY,SAASC,KAAe;AAC1C,IAAM,eAAe,SAASC,cAAkB;AAChD,IAAM,gBAAgB,SAASC,eAAmB;AAClD,IAAM,IAAI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AAM;KACnC,CAAC,CAAC,IAHF,KAAA,QAAA;MAGEC,UAAA,QAAA,KAAA,GAAA;;KAJJ,OAAA;IASM,EAAA,CAAA;WACN;KAGM,IAAA,SAAA,QAAA;KAHN,IAAA,SAAA,OAAA;;KACGJ,OAAA,QAAA,MADHb,MAGM;KAHNa,OAAA,QAEG,QAFHb,MAGM;KAHN,OAAA;IAGM,EAAA,CAAA;IACNC,KAAC,MAAQ;GAdV;EA4BC;CAAC,EAAA,CAAD,CACH;CArDP,OACEC;AAsDJ;AAEA,SAAgB,eAAe,OAA6B;CAC1D,MAAM,QAAQ;CACd,MAAM,OAAO,KAAK,OAAO,SAAS,UAAU;CAE1C,IAAA,SAAA,SAOI;CAHFgB,OAAA,QAAA,CAAA;EAHAf,MAAAA;EACA,aAAA;EACA,IAAA,UAAA;GAAO,OAAA,GAAG,kDAAkD,MAAM,KAAK;EAAC;CAChE,GAAJ,IAAA,GAAA,IAAA;CAJNU,OAAA,cAME;EAAC,OAAA,MAAM;CAAQ,CACb;CARN,OACET;AASJ"}
@@ -1,6 +1,6 @@
1
- import { cn } from "../../../lib/utils.js";
2
1
  import { insert, memo, spread, template } from "@solidjs/web";
3
2
  import { createSignal, getOwner as getOwner$1, omit, onSettled } from "solid-js";
3
+ import { cn } from "../../../lib/utils.js";
4
4
  // src/components/ui/avatar/avatar.tsx
5
5
  var _tmpl$ = /* @__PURE__ */ template(`<span>`);
6
6
  var _tmpl$2 = /* @__PURE__ */ template(`<img>`);
@@ -1 +1 @@
1
- {"version":3,"file":"avatar.js","names":["<span\n data-slot=\"avatar\"\n class={cn(\n 'relative flex shrink-0 overflow-hidden rounded-full select-none',\n avatarSizes[local.size ?? 'md'],\n local.class\n )}\n {...rest}\n />","<Show when={status() !== 'error'}>\n <img\n data-slot=\"avatar-image\"\n alt={local.alt ?? ''}\n class={cn('absolute inset-0 z-10 aspect-square size-full object-cover', local.class)}\n onLoad={() => update('loaded')}\n onError={() => update('error')}\n {...rest}\n />\n </Show>","onLoad={() => update('loaded')}","onError={() => update('error')}","<span\n data-slot=\"avatar-fallback\"\n class={cn(\n 'bg-muted text-muted-foreground flex size-full items-center justify-center rounded-full font-medium',\n { 'opacity-0': !revealed() },\n local.class\n )}\n {...rest}\n >\n <span aria-hidden=\"true\">{label()}</span>\n {local.name ? <span class=\"visually-hidden\">{local.name}</span> : null}\n </span>","getOwner"],"sources":["../../../../src/components/ui/avatar/avatar.tsx"],"sourcesContent":["import type { ComponentProps } from '@solidjs/web'\nimport { createSignal, getOwner, onSettled, Show, omit } from 'solid-js'\nimport { cn } from '#lib/utils'\n\n/**\n * Avatar.\n *\n * The fallback is painted *under* the image and the image is removed on error,\n * which is the arrangement that avoids every flicker case: a cached image\n * covers the fallback on the first paint, a slow image shows the fallback\n * until it arrives, and a broken image leaves the fallback in place instead of\n * a browser glyph.\n *\n * Initials are derived here so the rule lives in one place rather than in\n * every caller's string slicing: two words give two letters, one word gives\n * one, and a name with no letters gives nothing rather than a stray dot.\n */\nexport function initialsFrom(name: string): string {\n const parts = name.trim().split(/\\s+/).filter(Boolean)\n const first = parts[0]?.[0] ?? ''\n if (!first) return ''\n const last = parts.length > 1 ? (parts[parts.length - 1]?.[0] ?? '') : ''\n return (first + last).toUpperCase()\n}\n\nconst avatarSizes = {\n xs: 'size-5 text-2xs',\n sm: 'size-6 text-2xs',\n md: 'size-8 text-xs',\n lg: 'size-10 text-sm',\n xl: 'size-12 text-base',\n} as const\n\nexport type AvatarProps = ComponentProps<'span'> & {\n size?: keyof typeof avatarSizes\n}\n\nexport function Avatar(props: AvatarProps) {\n const local = props\n const rest = omit(props, 'class', 'size')\n\n return (\n <span\n data-slot=\"avatar\"\n class={cn(\n 'relative flex shrink-0 overflow-hidden rounded-full select-none',\n avatarSizes[local.size ?? 'md'],\n local.class\n )}\n {...rest}\n />\n )\n}\n\nexport type AvatarImageProps = Omit<ComponentProps<'img'>, 'onError'> & {\n onLoadingStatusChange?: (status: 'loading' | 'loaded' | 'error') => void\n}\n\nexport function AvatarImage(props: AvatarImageProps) {\n const local = props\n const rest = omit(props, 'class', 'alt', 'onLoadingStatusChange')\n const [status, setStatus] = createSignal<'loading' | 'loaded' | 'error'>('loading')\n\n const update = (next: 'loading' | 'loaded' | 'error') => {\n // A DOM may dispatch `load` or `error` synchronously while the renderer sets\n // `src` (happy-dom does for a data: URL), which runs this handler inside the\n // render and makes the write an owned-scope write. Such an event is replayed\n // from a microtask, outside the render; a browser always dispatches these\n // from a task of their own, so its events take the direct path.\n if (getOwner()) {\n queueMicrotask(() => update(next))\n return\n }\n setStatus(next)\n local.onLoadingStatusChange?.(next)\n }\n\n return (\n <Show when={status() !== 'error'}>\n <img\n data-slot=\"avatar-image\"\n alt={local.alt ?? ''}\n class={cn('absolute inset-0 z-10 aspect-square size-full object-cover', local.class)}\n onLoad={() => update('loaded')}\n onError={() => update('error')}\n {...rest}\n />\n </Show>\n )\n}\n\nexport type AvatarFallbackProps = ComponentProps<'span'> & {\n /** A person or entity name. Initials are derived from it. */\n name?: string\n /** Replace the derived initials with a glyph or emoji string. */\n content?: string\n /** How long to wait before showing the fallback, in ms. 0 shows it at once. */\n delay?: number\n}\n\nexport function AvatarFallback(props: AvatarFallbackProps) {\n const local = props\n const rest = omit(props, 'class', 'name', 'content', 'delay')\n const [revealed, setRevealed] = createSignal(() => (local.delay ?? 0) <= 0)\n\n onSettled(() => {\n const delay = local.delay ?? 0\n if (delay <= 0) return\n const timer = setTimeout(() => setRevealed(true), delay)\n return () => clearTimeout(timer)\n })\n\n const label = () => local.content ?? initialsFrom(local.name ?? '')\n\n return (\n <span\n data-slot=\"avatar-fallback\"\n class={cn(\n 'bg-muted text-muted-foreground flex size-full items-center justify-center rounded-full font-medium',\n { 'opacity-0': !revealed() },\n local.class\n )}\n {...rest}\n >\n <span aria-hidden=\"true\">{label()}</span>\n {local.name ? <span class=\"visually-hidden\">{local.name}</span> : null}\n </span>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAiBA,SAAgB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A,KAAA;GANN,OAAA;EAOC,EAAA,CAAA,IARH,KAAA;CASM,CAAA;AAEV;AAWA,SAAgB,eAAe,OAA4B;CACzD,MAAM,QAAQ;CACd,MAAM,OAAO,KAAK,OAAO,SAAS,QAAQ,WAAW,OAAO;CAC5D,MAAM,CAAC,UAAU,eAAe,oBAAoB,MAAM,SAAS,MAAM,CAAC;CAE1E,gBAAgB;EACd,MAAM,QAAQ,MAAM,SAAS;EAC7B,IAAI,SAAS,GAAG;EAChB,MAAM,QAAQ,iBAAiB,YAAY,IAAI,GAAG,KAAK;EACvD,aAAa,aAAa,KAAK;CACjC,CAAC;CAED,MAAM,cAAc,MAAM,WAAW,aAAa,MAAM,QAAQ,EAAE;CAGhE,IAAA,QAAA,QAWM;CAFJ,IAAA,QAAA,MAAA;CAFA,OAAA,OAAA,CAAA;EANA,aAAA;EACA,IAAA,UAAA;GAAO,OAAA,GACL,sGACA,EAAE,aAAa,CAAC,SAAS,EAAE,GAC3B,MAAM,KACR;EAAC;CACO,GAAJ,IAAA,GAAA,IAAA;CAEJ,OAAA,OAA0B,KAAc;CAT1C,OAAA,cAUE;;GAAC,OAAA,CAAA,CAAA,MAAM;EAA+D,CAAA;EAAtE,aAAA;GAAsE,OAAA,IAAA,WAAxD;IAAgD,IAAA,QAAA,QAAA;IAAhD,OAAA,aAA8B;KAAC,OAAA,MAAM;IAAI,CAAO;IAAhD,OAAA;GAAgD,EAAA,CAAA,IAAI;EAAI;CAAC,EAAA,CAAD,GAVxE,IAWM;CAZR,OACEC;AAaJ"}
1
+ {"version":3,"file":"avatar.js","names":["<span\n data-slot=\"avatar\"\n class={cn(\n 'relative flex shrink-0 overflow-hidden rounded-full select-none',\n avatarSizes[local.size ?? 'md'],\n local.class\n )}\n {...rest}\n />","<Show when={status() !== 'error'}>\n <img\n data-slot=\"avatar-image\"\n alt={local.alt ?? ''}\n class={cn('absolute inset-0 z-10 aspect-square size-full object-cover', local.class)}\n onLoad={() => update('loaded')}\n onError={() => update('error')}\n {...rest}\n />\n </Show>","onLoad={() => update('loaded')}","onError={() => update('error')}","<span\n data-slot=\"avatar-fallback\"\n class={cn(\n 'bg-muted text-muted-foreground flex size-full items-center justify-center rounded-full font-medium',\n { 'opacity-0': !revealed() },\n local.class\n )}\n {...rest}\n >\n <span aria-hidden=\"true\">{label()}</span>\n {local.name ? <span class=\"visually-hidden\">{local.name}</span> : null}\n </span>","_$spread","getOwner","_$insert"],"sources":["../../../../src/components/ui/avatar/avatar.tsx"],"sourcesContent":["import type { ComponentProps } from '@solidjs/web'\nimport { createSignal, getOwner, onSettled, Show, omit } from 'solid-js'\nimport { cn } from '#lib/utils'\n\n/**\n * Avatar.\n *\n * The fallback is painted *under* the image and the image is removed on error,\n * which is the arrangement that avoids every flicker case: a cached image\n * covers the fallback on the first paint, a slow image shows the fallback\n * until it arrives, and a broken image leaves the fallback in place instead of\n * a browser glyph.\n *\n * Initials are derived here so the rule lives in one place rather than in\n * every caller's string slicing: two words give two letters, one word gives\n * one, and a name with no letters gives nothing rather than a stray dot.\n */\nexport function initialsFrom(name: string): string {\n const parts = name.trim().split(/\\s+/).filter(Boolean)\n const first = parts[0]?.[0] ?? ''\n if (!first) return ''\n const last = parts.length > 1 ? (parts[parts.length - 1]?.[0] ?? '') : ''\n return (first + last).toUpperCase()\n}\n\nconst avatarSizes = {\n xs: 'size-5 text-2xs',\n sm: 'size-6 text-2xs',\n md: 'size-8 text-xs',\n lg: 'size-10 text-sm',\n xl: 'size-12 text-base',\n} as const\n\nexport type AvatarProps = ComponentProps<'span'> & {\n size?: keyof typeof avatarSizes\n}\n\nexport function Avatar(props: AvatarProps) {\n const local = props\n const rest = omit(props, 'class', 'size')\n\n return (\n <span\n data-slot=\"avatar\"\n class={cn(\n 'relative flex shrink-0 overflow-hidden rounded-full select-none',\n avatarSizes[local.size ?? 'md'],\n local.class\n )}\n {...rest}\n />\n )\n}\n\nexport type AvatarImageProps = Omit<ComponentProps<'img'>, 'onError'> & {\n onLoadingStatusChange?: (status: 'loading' | 'loaded' | 'error') => void\n}\n\nexport function AvatarImage(props: AvatarImageProps) {\n const local = props\n const rest = omit(props, 'class', 'alt', 'onLoadingStatusChange')\n const [status, setStatus] = createSignal<'loading' | 'loaded' | 'error'>('loading')\n\n const update = (next: 'loading' | 'loaded' | 'error') => {\n // A DOM may dispatch `load` or `error` synchronously while the renderer sets\n // `src` (happy-dom does for a data: URL), which runs this handler inside the\n // render and makes the write an owned-scope write. Such an event is replayed\n // from a microtask, outside the render; a browser always dispatches these\n // from a task of their own, so its events take the direct path.\n if (getOwner()) {\n queueMicrotask(() => update(next))\n return\n }\n setStatus(next)\n local.onLoadingStatusChange?.(next)\n }\n\n return (\n <Show when={status() !== 'error'}>\n <img\n data-slot=\"avatar-image\"\n alt={local.alt ?? ''}\n class={cn('absolute inset-0 z-10 aspect-square size-full object-cover', local.class)}\n onLoad={() => update('loaded')}\n onError={() => update('error')}\n {...rest}\n />\n </Show>\n )\n}\n\nexport type AvatarFallbackProps = ComponentProps<'span'> & {\n /** A person or entity name. Initials are derived from it. */\n name?: string\n /** Replace the derived initials with a glyph or emoji string. */\n content?: string\n /** How long to wait before showing the fallback, in ms. 0 shows it at once. */\n delay?: number\n}\n\nexport function AvatarFallback(props: AvatarFallbackProps) {\n const local = props\n const rest = omit(props, 'class', 'name', 'content', 'delay')\n const [revealed, setRevealed] = createSignal(() => (local.delay ?? 0) <= 0)\n\n onSettled(() => {\n const delay = local.delay ?? 0\n if (delay <= 0) return\n const timer = setTimeout(() => setRevealed(true), delay)\n return () => clearTimeout(timer)\n })\n\n const label = () => local.content ?? initialsFrom(local.name ?? '')\n\n return (\n <span\n data-slot=\"avatar-fallback\"\n class={cn(\n 'bg-muted text-muted-foreground flex size-full items-center justify-center rounded-full font-medium',\n { 'opacity-0': !revealed() },\n local.class\n )}\n {...rest}\n >\n <span aria-hidden=\"true\">{label()}</span>\n {local.name ? <span class=\"visually-hidden\">{local.name}</span> : null}\n </span>\n )\n}\n"],"mappings":";;;;;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AAO,OAAO;GACrB,GAAJ,IAAA,GAAA,KAAA;GANN,OAAA;EAOC,EAAA,CAAA,IARH,KAAA;CASM,CAAA;AAEV;AAWA,SAAgB,eAAe,OAA4B;CACzD,MAAM,QAAQ;CACd,MAAM,OAAO,KAAK,OAAO,SAAS,QAAQ,WAAW,OAAO;CAC5D,MAAM,CAAC,UAAU,eAAe,oBAAoB,MAAM,SAAS,MAAM,CAAC;CAE1E,gBAAgB;EACd,MAAM,QAAQ,MAAM,SAAS;EAC7B,IAAI,SAAS,GAAG;EAChB,MAAM,QAAQ,iBAAiB,YAAY,IAAI,GAAG,KAAK;EACvD,aAAa,aAAa,KAAK;CACjC,CAAC;CAED,MAAM,cAAc,MAAM,WAAW,aAAa,MAAM,QAAQ,EAAE;CAGhE,IAAA,QAAA,QAWM;CAFJ,IAAA,QAAA,MAAA;CAFAE,OAAA,OAAA,CAAA;EANA,aAAA;EACA,IAAA,UAAA;GAAO,OAAA,GACL,sGACA,EAAE,aAAa,CAAC,SAAS,EAAE,GAC3B,MAAM,KACR;EAAC;CACO,GAAJ,IAAA,GAAA,IAAA;CAEJE,OAAA,OAA0B,KAAc;CAT1CA,OAAA,cAUE;;GAAC,OAAA,CAAA,CAAA,MAAM;EAA+D,CAAA;EAAtE,aAAA;GAAsE,OAAA,IAAA,WAAxD;IAAgD,IAAA,QAAA,QAAA;IAAhDA,OAAA,aAA8B;KAAC,OAAA,MAAM;IAAI,CAAO;IAAhD,OAAA;GAAgD,EAAA,CAAA,IAAI;EAAI;CAAC,EAAA,CAAD,GAVxE,IAWM;CAZR,OACEH;AAaJ"}
@@ -1,7 +1,7 @@
1
- import { cva } from "../../../lib/variants.js";
2
- import { cn } from "../../../lib/utils.js";
3
1
  import { Dynamic, createComponent, memo, mergeProps, spread, template } from "@solidjs/web";
4
2
  import { omit } from "solid-js";
3
+ import { cva } from "../../../lib/variants.js";
4
+ import { cn } from "../../../lib/utils.js";
5
5
  // src/components/ui/badge/badge.tsx
6
6
  var _tmpl$ = /* @__PURE__ */ template(`<span>`);
7
7
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"badge.js","names":["<Show\n when={local.as === undefined || local.as === 'span'}\n fallback={\n <Dynamic\n component={local.as}\n data-slot=\"badge\"\n class={className()}\n {...(rest as ComponentProps<'span'>)}\n />\n }\n >\n <span data-slot=\"badge\" class={className()} {...(rest as ComponentProps<'span'>)} />\n </Show>","<Dynamic\n component={local.as}\n data-slot=\"badge\"\n class={className()}\n {...(rest as ComponentProps<'span'>)}\n />"],"sources":["../../../../src/components/ui/badge/badge.tsx"],"sourcesContent":["import { Show, omit } from 'solid-js'\nimport { Dynamic, type ComponentProps, type JSX, type ValidComponent } from '@solidjs/web'\nimport { cva, type VariantProps } from '#lib/variants'\nimport { cn } from '#lib/utils'\n\n/**\n * Badge.\n *\n * A short, non-interactive status label. If it can be clicked it is a Button\n * with `size=\"2xs\"`, not a Badge, the difference matters because a Badge\n * carries no focus or pressed state and must never be the only way to reach an\n * action.\n */\nexport const badgeVariants = cva(\n 'inline-flex w-fit shrink-0 items-center justify-center gap-1 whitespace-nowrap rounded-full border border-transparent font-medium transition-colors [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg]:size-3',\n {\n variants: {\n variant: {\n default: 'bg-primary text-primary-foreground',\n secondary: 'bg-secondary text-secondary-foreground',\n outline: 'border-border text-foreground',\n /**\n * Tinted status fills, for counts and states rather than actions. The\n * word stays in `foreground` for contrast; the glyph takes the status\n * hue, so tags of different tones read apart at a glance.\n */\n success: 'bg-success-subtle text-foreground [&_svg]:text-success',\n warning: 'bg-warning-subtle text-foreground [&_svg]:text-warning',\n destructive: 'bg-destructive-subtle text-foreground [&_svg]:text-destructive',\n info: 'bg-info-subtle text-foreground [&_svg]:text-info',\n subtle: 'bg-primary-subtle text-primary',\n /**\n * A count that asks for attention, pinned to a corner of another control\n * (a workspace mark, a rail icon). At `sm` it is a 2xs label on whatever\n * surface sits behind the corner, where the destructive tint all but\n * disappears, so it takes the solid, contrast-measured action fill.\n */\n notification: 'bg-destructive-action text-destructive-action-foreground',\n },\n size: {\n sm: 'h-4 px-1.5 text-2xs',\n md: 'h-5 px-2 text-xs',\n lg: 'h-6 px-2.5 text-xs',\n },\n },\n defaultVariants: {\n variant: 'default',\n size: 'md',\n },\n }\n)\n\ntype BadgeVariantProps = VariantProps<typeof badgeVariants>\n\n/**\n * The props of `T` with `Props` laid over them, plus `as`: the shape of the\n * Kobalte `PolymorphicProps` this replaced, so the exported prop types keep\n * their meaning.\n */\ntype PolymorphicProps<T extends ValidComponent, Props extends object = {}> = Omit<\n ComponentProps<T>,\n keyof Props | 'as'\n> &\n Props & { as?: T | keyof JSX.IntrinsicElements }\n\nexport type BadgeProps<T extends ValidComponent = 'span'> = PolymorphicProps<\n T,\n BadgeVariantProps & { class?: string }\n>\n\nexport function Badge<T extends ValidComponent = 'span'>(props: BadgeProps<T>) {\n const local = props as BadgeProps & { as?: ValidComponent }\n const rest = omit(local, 'as', 'variant', 'size', 'class')\n const className = () =>\n cn(badgeVariants({ variant: local.variant, size: local.size }), local.class)\n\n // A plain span, the common case, is written directly: Dynamic goes through\n // a component lookup and a memo per badge.\n return (\n <Show\n when={local.as === undefined || local.as === 'span'}\n fallback={\n <Dynamic\n component={local.as}\n data-slot=\"badge\"\n class={className()}\n {...(rest as ComponentProps<'span'>)}\n />\n }\n >\n <span data-slot=\"badge\" class={className()} {...(rest as ComponentProps<'span'>)} />\n </Show>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;AAaA,IAAa,gBAAgB,IAC3B,mNACA;CACE,UAAU;EACR,SAAS;GACP,SAAS;GACT,WAAW;GACX,SAAS;;;;;;GAMT,SAAS;GACT,SAAS;GACT,aAAa;GACb,MAAM;GACN,QAAQ;;;;;;;GAOR,cAAc;EAChB;EACA,MAAM;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;EACN;CACF;CACA,iBAAiB;EACf,SAAS;EACT,MAAM;CACR;AACF,CACF;AAoBA,SAAgB,MAAyC,OAAsB;CAC7E,MAAM,QAAQ;CACd,MAAM,OAAO,KAAK,OAAO,MAAM,WAAW,QAAQ,OAAO;CACzD,MAAM,kBACJ,GAAG,cAAc;EAAE,SAAS,MAAM;EAAS,MAAM,MAAM;CAAK,CAAC,GAAG,MAAM,KAAK;CAI7E,OACEA,WAAAA;;GACQ,OAAA,CAAA,EAAA,MAAM,OAAO,KAAA,KAAa,MAAM,OAAO;EAWzC,CAAA,CAAC,CAAD,WADJ;GAAmF,IAAA,OAAA,OAAA;GAAvC,OAAA,MAAA,CAAA;IAAtC,aAAA;IAAkB,IAAA,UAAA;KAAO,OAAA,UAAU;IAAC;GAAsC,GAA/B,IAAuB,GAAA,KAAA;GAAxE,OAAA;EAAmF,EAAA,CAAA,IARjFC,gBAAAA,SAAAA,WAAAA;GACE,IAAA,YAAA;IAAW,OAAA,MAAM;GAAE;GACnB,aAAU;GACV,IAAA,UAAA;IAAO,OAAA,UAAU;GAAC;EAEnB,GADM,IACN,CAAA;CAIC,CAAA;AAEV"}
1
+ {"version":3,"file":"badge.js","names":["<Show\n when={local.as === undefined || local.as === 'span'}\n fallback={\n <Dynamic\n component={local.as}\n data-slot=\"badge\"\n class={className()}\n {...(rest as ComponentProps<'span'>)}\n />\n }\n >\n <span data-slot=\"badge\" class={className()} {...(rest as ComponentProps<'span'>)} />\n </Show>","<Dynamic\n component={local.as}\n data-slot=\"badge\"\n class={className()}\n {...(rest as ComponentProps<'span'>)}\n />","_$spread"],"sources":["../../../../src/components/ui/badge/badge.tsx"],"sourcesContent":["import { Show, omit } from 'solid-js'\nimport { Dynamic, type ComponentProps, type JSX, type ValidComponent } from '@solidjs/web'\nimport { cva, type VariantProps } from '#lib/variants'\nimport { cn } from '#lib/utils'\n\n/**\n * Badge.\n *\n * A short, non-interactive status label. If it can be clicked it is a Button\n * with `size=\"2xs\"`, not a Badge, the difference matters because a Badge\n * carries no focus or pressed state and must never be the only way to reach an\n * action.\n */\nexport const badgeVariants = cva(\n 'inline-flex w-fit shrink-0 items-center justify-center gap-1 whitespace-nowrap rounded-full border border-transparent font-medium transition-colors [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg]:size-3',\n {\n variants: {\n variant: {\n default: 'bg-primary text-primary-foreground',\n secondary: 'bg-secondary text-secondary-foreground',\n outline: 'border-border text-foreground',\n /**\n * Tinted status fills, for counts and states rather than actions. The\n * word stays in `foreground` for contrast; the glyph takes the status\n * hue, so tags of different tones read apart at a glance.\n */\n success: 'bg-success-subtle text-foreground [&_svg]:text-success',\n warning: 'bg-warning-subtle text-foreground [&_svg]:text-warning',\n destructive: 'bg-destructive-subtle text-foreground [&_svg]:text-destructive',\n info: 'bg-info-subtle text-foreground [&_svg]:text-info',\n subtle: 'bg-primary-subtle text-primary',\n /**\n * A count that asks for attention, pinned to a corner of another control\n * (a workspace mark, a rail icon). At `sm` it is a 2xs label on whatever\n * surface sits behind the corner, where the destructive tint all but\n * disappears, so it takes the solid, contrast-measured action fill.\n */\n notification: 'bg-destructive-action text-destructive-action-foreground',\n },\n size: {\n sm: 'h-4 px-1.5 text-2xs',\n md: 'h-5 px-2 text-xs',\n lg: 'h-6 px-2.5 text-xs',\n },\n },\n defaultVariants: {\n variant: 'default',\n size: 'md',\n },\n }\n)\n\ntype BadgeVariantProps = VariantProps<typeof badgeVariants>\n\n/**\n * The props of `T` with `Props` laid over them, plus `as`: the shape of the\n * Kobalte `PolymorphicProps` this replaced, so the exported prop types keep\n * their meaning.\n */\ntype PolymorphicProps<T extends ValidComponent, Props extends object = {}> = Omit<\n ComponentProps<T>,\n keyof Props | 'as'\n> &\n Props & { as?: T | keyof JSX.IntrinsicElements }\n\nexport type BadgeProps<T extends ValidComponent = 'span'> = PolymorphicProps<\n T,\n BadgeVariantProps & { class?: string }\n>\n\nexport function Badge<T extends ValidComponent = 'span'>(props: BadgeProps<T>) {\n const local = props as BadgeProps & { as?: ValidComponent }\n const rest = omit(local, 'as', 'variant', 'size', 'class')\n const className = () =>\n cn(badgeVariants({ variant: local.variant, size: local.size }), local.class)\n\n // A plain span, the common case, is written directly: Dynamic goes through\n // a component lookup and a memo per badge.\n return (\n <Show\n when={local.as === undefined || local.as === 'span'}\n fallback={\n <Dynamic\n component={local.as}\n data-slot=\"badge\"\n class={className()}\n {...(rest as ComponentProps<'span'>)}\n />\n }\n >\n <span data-slot=\"badge\" class={className()} {...(rest as ComponentProps<'span'>)} />\n </Show>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;AAaA,IAAa,gBAAgB,IAC3B,mNACA;CACE,UAAU;EACR,SAAS;GACP,SAAS;GACT,WAAW;GACX,SAAS;;;;;;GAMT,SAAS;GACT,SAAS;GACT,aAAa;GACb,MAAM;GACN,QAAQ;;;;;;;GAOR,cAAc;EAChB;EACA,MAAM;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;EACN;CACF;CACA,iBAAiB;EACf,SAAS;EACT,MAAM;CACR;AACF,CACF;AAoBA,SAAgB,MAAyC,OAAsB;CAC7E,MAAM,QAAQ;CACd,MAAM,OAAO,KAAK,OAAO,MAAM,WAAW,QAAQ,OAAO;CACzD,MAAM,kBACJ,GAAG,cAAc;EAAE,SAAS,MAAM;EAAS,MAAM,MAAM;CAAK,CAAC,GAAG,MAAM,KAAK;CAI7E,OACEA,WAAAA;;GACQ,OAAA,CAAA,EAAA,MAAM,OAAO,KAAA,KAAa,MAAM,OAAO;EAWzC,CAAA,CAAC,CAAD,WADJ;GAAmF,IAAA,OAAA,OAAA;GAAvCE,OAAA,MAAA,CAAA;IAAtC,aAAA;IAAkB,IAAA,UAAA;KAAO,OAAA,UAAU;IAAC;GAAsC,GAA/B,IAAuB,GAAA,KAAA;GAAxE,OAAA;EAAmF,EAAA,CAAA,IARjFD,gBAAAA,SAAAA,WAAAA;GACE,IAAA,YAAA;IAAW,OAAA,MAAM;GAAE;GACnB,aAAU;GACV,IAAA,UAAA;IAAO,OAAA,UAAU;GAAC;EAEnB,GADM,IACN,CAAA;CAIC,CAAA;AAEV"}