@ctrl-ui/react 0.8.6 → 0.8.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 (376) hide show
  1. package/dist/action-bar.d.ts +15 -7
  2. package/dist/action-bar.js +39 -19
  3. package/dist/activity.js +7 -15
  4. package/dist/audio-recorder.d.ts +14 -4
  5. package/dist/audio-recorder.js +82 -29
  6. package/dist/audio-visualizer.js +1 -1
  7. package/dist/blocks/coding-agent.js +54 -57
  8. package/dist/blocks/design-canvas-data.d.ts +32 -0
  9. package/dist/blocks/design-canvas-data.js +100 -0
  10. package/dist/blocks/design-canvas-inspector.d.ts +8 -0
  11. package/dist/blocks/design-canvas-inspector.js +238 -0
  12. package/dist/blocks/design-canvas.d.ts +21 -0
  13. package/dist/blocks/design-canvas.js +452 -0
  14. package/dist/blocks/discussion.d.ts +28 -0
  15. package/dist/blocks/discussion.js +67 -0
  16. package/dist/blocks/file-explorer-data.d.ts +1 -0
  17. package/dist/blocks/file-explorer-data.js +4 -1
  18. package/dist/blocks/file-explorer.d.ts +9 -1
  19. package/dist/blocks/file-explorer.js +461 -192
  20. package/dist/blocks/settings.d.ts +2 -1
  21. package/dist/blocks/settings.js +101 -79
  22. package/dist/blocks/team-chat.d.ts +12 -0
  23. package/dist/blocks/team-chat.js +26 -0
  24. package/dist/blocks/theme-toggle.js +23 -31
  25. package/dist/chat-composer-attachment.d.ts +12 -3
  26. package/dist/chat-composer-attachment.js +61 -19
  27. package/dist/chat-composer-editor/extensions/mention.d.ts +5 -1
  28. package/dist/chat-composer-editor/extensions/mention.js +58 -27
  29. package/dist/chat-composer-editor/ghost.js +2 -4
  30. package/dist/chat-composer-editor/types.d.ts +5 -0
  31. package/dist/chat-composer-editor.d.ts +1 -1
  32. package/dist/chat-composer-editor.js +71 -28
  33. package/dist/chat-composer.d.ts +13 -32
  34. package/dist/chat-composer.js +54 -13
  35. package/dist/chat-layout.d.ts +19 -0
  36. package/dist/chat-layout.js +96 -32
  37. package/dist/chat-message/social.d.ts +26 -0
  38. package/dist/chat-message/social.js +122 -0
  39. package/dist/chat-message.d.ts +28 -29
  40. package/dist/chat-message.js +106 -25
  41. package/dist/context.d.ts +2 -2
  42. package/dist/context.js +38 -23
  43. package/dist/dynamic-notification-canvas-loop.d.ts +24 -0
  44. package/dist/dynamic-notification-canvas-loop.js +113 -0
  45. package/dist/dynamic-notification-glass.js +23 -114
  46. package/dist/dynamic-notification-liquid.js +14 -118
  47. package/dist/dynamic-notification.d.ts +16 -8
  48. package/dist/dynamic-notification.js +85 -22
  49. package/dist/email/email-brand.d.ts +7 -4
  50. package/dist/email/email-brand.js +9 -6
  51. package/dist/email/email-code.d.ts +3 -2
  52. package/dist/email/email-code.js +11 -9
  53. package/dist/email/email-footer.d.ts +5 -3
  54. package/dist/email/email-footer.js +11 -5
  55. package/dist/email/email.d.ts +31 -9
  56. package/dist/email/email.js +50 -26
  57. package/dist/email/templates.d.ts +10 -9
  58. package/dist/email/templates.js +102 -38
  59. package/dist/email/theme.js +1 -1
  60. package/dist/environment-variables.d.ts +4 -2
  61. package/dist/environment-variables.js +52 -32
  62. package/dist/filter-bar/context.d.ts +32 -0
  63. package/dist/filter-bar/context.js +11 -0
  64. package/dist/filter-bar/editor.d.ts +14 -0
  65. package/dist/filter-bar/editor.js +216 -0
  66. package/dist/filter-bar/model.d.ts +10 -0
  67. package/dist/filter-bar/model.js +57 -0
  68. package/dist/filter-bar/motion.d.ts +10 -0
  69. package/dist/filter-bar/motion.js +84 -0
  70. package/dist/filter-bar/parts.d.ts +19 -0
  71. package/dist/filter-bar/parts.js +244 -0
  72. package/dist/filter-bar/types.d.ts +54 -0
  73. package/dist/filter-bar/types.js +0 -0
  74. package/dist/filter-bar.d.ts +27 -0
  75. package/dist/filter-bar.js +310 -0
  76. package/dist/hooks/use-audio-recorder.js +12 -6
  77. package/dist/hooks/use-chat-composer.d.ts +21 -7
  78. package/dist/hooks/use-chat-composer.js +32 -5
  79. package/dist/hooks/use-chat-message.d.ts +28 -2
  80. package/dist/hooks/use-chat-message.js +41 -10
  81. package/dist/hooks/use-chat-thread-scroll.js +43 -7
  82. package/dist/hooks/use-color-area.d.ts +3 -3
  83. package/dist/hooks/use-color-area.js +13 -12
  84. package/dist/hooks/use-copy-to-clipboard.d.ts +2 -1
  85. package/dist/hooks/use-copy-to-clipboard.js +20 -20
  86. package/dist/hooks/use-dropzone.d.ts +7 -4
  87. package/dist/hooks/use-dropzone.js +34 -3
  88. package/dist/hooks/use-dynamic-notification.d.ts +6 -2
  89. package/dist/hooks/use-dynamic-notification.js +26 -10
  90. package/dist/hooks/use-mobile.d.ts +3 -2
  91. package/dist/hooks/use-mobile.js +8 -4
  92. package/dist/hooks/use-textarea-trigger-menu.js +2 -1
  93. package/dist/hooks/use-trigger-menu.d.ts +54 -0
  94. package/dist/hooks/use-trigger-menu.js +102 -47
  95. package/dist/hooks/use-user-ask.d.ts +2 -0
  96. package/dist/hooks/use-user-ask.js +35 -41
  97. package/dist/inline-attachment.d.ts +6 -2
  98. package/dist/inline-attachment.js +44 -29
  99. package/dist/inline-citation.d.ts +12 -5
  100. package/dist/inline-citation.js +25 -16
  101. package/dist/knob-contracts/audio-recorder-knobs.d.ts +1 -1
  102. package/dist/knob-contracts/audio-recorder-knobs.js +2 -1
  103. package/dist/knob-contracts/audio-visualizer-knobs.d.ts +1 -1
  104. package/dist/knob-contracts/audio-visualizer-knobs.js +2 -1
  105. package/dist/knob-contracts/avatar-knobs.d.ts +1 -1
  106. package/dist/knob-contracts/avatar-knobs.js +6 -1
  107. package/dist/knob-contracts/badge-knobs.d.ts +1 -1
  108. package/dist/knob-contracts/badge-knobs.js +2 -1
  109. package/dist/knob-contracts/breadcrumb-knobs.d.ts +4 -0
  110. package/dist/knob-contracts/breadcrumb-knobs.js +8 -0
  111. package/dist/knob-contracts/button-knobs.d.ts +1 -1
  112. package/dist/knob-contracts/button-knobs.js +1 -0
  113. package/dist/knob-contracts/chat-layout-knobs.d.ts +1 -1
  114. package/dist/knob-contracts/chat-layout-knobs.js +2 -1
  115. package/dist/knob-contracts/chat-message-knobs.d.ts +1 -1
  116. package/dist/knob-contracts/chat-message-knobs.js +8 -1
  117. package/dist/knob-contracts/choice-knobs.d.ts +1 -1
  118. package/dist/knob-contracts/choice-knobs.js +1 -0
  119. package/dist/knob-contracts/code-diff-knobs.d.ts +1 -1
  120. package/dist/knob-contracts/code-diff-knobs.js +2 -0
  121. package/dist/knob-contracts/code-knobs.d.ts +1 -1
  122. package/dist/knob-contracts/code-knobs.js +2 -1
  123. package/dist/knob-contracts/collapsible-knobs.d.ts +1 -1
  124. package/dist/knob-contracts/collapsible-knobs.js +1 -1
  125. package/dist/knob-contracts/dynamic-notification-knobs.d.ts +1 -1
  126. package/dist/knob-contracts/dynamic-notification-knobs.js +2 -0
  127. package/dist/knob-contracts/emoji-picker-knobs.d.ts +4 -0
  128. package/dist/knob-contracts/emoji-picker-knobs.js +10 -0
  129. package/dist/knob-contracts/field-knobs.d.ts +1 -1
  130. package/dist/knob-contracts/field-knobs.js +5 -1
  131. package/dist/knob-contracts/filter-bar-knobs.d.ts +4 -0
  132. package/dist/knob-contracts/filter-bar-knobs.js +15 -0
  133. package/dist/knob-contracts/infinite-canvas-knobs.d.ts +1 -1
  134. package/dist/knob-contracts/infinite-canvas-knobs.js +3 -0
  135. package/dist/knob-contracts/markdown-knobs.d.ts +1 -1
  136. package/dist/knob-contracts/markdown-knobs.js +3 -1
  137. package/dist/knob-contracts/page-layout-knobs.d.ts +1 -1
  138. package/dist/knob-contracts/page-layout-knobs.js +4 -1
  139. package/dist/knob-contracts/popup-knobs.d.ts +1 -1
  140. package/dist/knob-contracts/popup-knobs.js +28 -0
  141. package/dist/knob-contracts/range-knobs.d.ts +1 -1
  142. package/dist/knob-contracts/range-knobs.js +1 -0
  143. package/dist/knob-contracts/rich-tooltip-knobs.d.ts +1 -1
  144. package/dist/knob-contracts/rich-tooltip-knobs.js +2 -1
  145. package/dist/knob-contracts/sidebar-knobs.d.ts +1 -1
  146. package/dist/knob-contracts/sidebar-knobs.js +27 -2
  147. package/dist/knob-contracts/spinner-knobs.d.ts +1 -1
  148. package/dist/knob-contracts/spinner-knobs.js +1 -1
  149. package/dist/knob-contracts/stepper-knobs.d.ts +1 -1
  150. package/dist/knob-contracts/stepper-knobs.js +4 -1
  151. package/dist/knob-contracts/switch-knobs.d.ts +1 -1
  152. package/dist/knob-contracts/switch-knobs.js +5 -0
  153. package/dist/knob-contracts/table-of-contents-knobs.d.ts +1 -1
  154. package/dist/knob-contracts/table-of-contents-knobs.js +4 -5
  155. package/dist/knob-contracts/tabs-knobs.d.ts +1 -1
  156. package/dist/knob-contracts/tabs-knobs.js +1 -0
  157. package/dist/knob-contracts/tree-knobs.d.ts +1 -1
  158. package/dist/knob-contracts/tree-knobs.js +2 -1
  159. package/dist/lib/cn.js +0 -4
  160. package/dist/lib/contrast.d.ts +1 -0
  161. package/dist/lib/contrast.js +17 -5
  162. package/dist/lib/dropzone-validation.js +41 -28
  163. package/dist/lib/env-file.d.ts +1 -1
  164. package/dist/lib/env-file.js +5 -5
  165. package/dist/lib/motion.d.ts +4 -0
  166. package/dist/lib/motion.js +15 -0
  167. package/dist/lib/trigger-detect.js +6 -8
  168. package/dist/markdown-block.js +13 -8
  169. package/dist/popup-parts.d.ts +8 -0
  170. package/dist/popup-parts.js +43 -0
  171. package/dist/scripts/contrast-eval.js +5 -4
  172. package/dist/source-badge.js +3 -1
  173. package/dist/styles/code.css +0 -2
  174. package/dist/styles/effects.css +6 -32
  175. package/dist/styles/index.css +14 -8
  176. package/dist/styles/recipes/accordion.css +9 -6
  177. package/dist/styles/recipes/action-bar.css +0 -15
  178. package/dist/styles/recipes/activity.css +5 -11
  179. package/dist/styles/recipes/alert.css +4 -4
  180. package/dist/styles/recipes/audio-recorder.css +15 -3
  181. package/dist/styles/recipes/audio-visualizer.css +13 -2
  182. package/dist/styles/recipes/avatar.css +78 -1
  183. package/dist/styles/recipes/badge.css +14 -4
  184. package/dist/styles/recipes/breadcrumb.css +77 -0
  185. package/dist/styles/recipes/button-group.css +6 -8
  186. package/dist/styles/recipes/button-states.css +66 -0
  187. package/dist/styles/recipes/button.css +26 -85
  188. package/dist/styles/recipes/calendar.css +17 -23
  189. package/dist/styles/recipes/card.css +2 -2
  190. package/dist/styles/recipes/chat-composer-attachment.css +9 -3
  191. package/dist/styles/recipes/chat-composer.css +21 -16
  192. package/dist/styles/recipes/chat-layout.css +64 -2
  193. package/dist/styles/recipes/chat-message-social.css +123 -0
  194. package/dist/styles/recipes/chat-message.css +157 -37
  195. package/dist/styles/recipes/choice.css +25 -21
  196. package/dist/styles/recipes/code-diff.css +51 -26
  197. package/dist/styles/recipes/code.css +44 -18
  198. package/dist/styles/recipes/collapsible.css +43 -1
  199. package/dist/styles/recipes/color-picker-details.css +3 -4
  200. package/dist/styles/recipes/color-picker-values.css +9 -8
  201. package/dist/styles/recipes/color-picker.css +23 -4
  202. package/dist/styles/recipes/context.css +3 -3
  203. package/dist/styles/recipes/dockable-panel.css +18 -7
  204. package/dist/styles/recipes/dropzone.css +7 -8
  205. package/dist/styles/recipes/dynamic-notification-input.css +8 -5
  206. package/dist/styles/recipes/dynamic-notification-motion.css +12 -21
  207. package/dist/styles/recipes/dynamic-notification.css +40 -26
  208. package/dist/styles/recipes/emoji-picker.css +132 -0
  209. package/dist/styles/recipes/empty.css +5 -4
  210. package/dist/styles/recipes/environment-variables.css +4 -15
  211. package/dist/styles/recipes/field-parts.css +89 -21
  212. package/dist/styles/recipes/field.css +83 -26
  213. package/dist/styles/recipes/filter-bar.css +161 -0
  214. package/dist/styles/recipes/gradient-editor.css +18 -7
  215. package/dist/styles/recipes/infinite-canvas.css +51 -4
  216. package/dist/styles/recipes/inline-attachment.css +9 -4
  217. package/dist/styles/recipes/inline-citation.css +10 -4
  218. package/dist/styles/recipes/item.css +23 -9
  219. package/dist/styles/recipes/markdown-block.css +5 -4
  220. package/dist/styles/recipes/markdown.css +68 -26
  221. package/dist/styles/recipes/morphing-panel.css +8 -8
  222. package/dist/styles/recipes/page-layout.css +36 -10
  223. package/dist/styles/recipes/pagination.css +5 -6
  224. package/dist/styles/recipes/phone-input.css +12 -8
  225. package/dist/styles/recipes/popup-controls.css +175 -26
  226. package/dist/styles/recipes/popup-drawer.css +35 -44
  227. package/dist/styles/recipes/popup-lists.css +139 -29
  228. package/dist/styles/recipes/popup-motion.css +4 -45
  229. package/dist/styles/recipes/popup-toast.css +55 -26
  230. package/dist/styles/recipes/popup.css +149 -153
  231. package/dist/styles/recipes/range.css +55 -19
  232. package/dist/styles/recipes/resizable.css +36 -7
  233. package/dist/styles/recipes/rich-tooltip.css +24 -34
  234. package/dist/styles/recipes/scroll-area.css +8 -1
  235. package/dist/styles/recipes/sidebar-menu.css +149 -34
  236. package/dist/styles/recipes/sidebar-parts.css +154 -0
  237. package/dist/styles/recipes/sidebar.css +187 -128
  238. package/dist/styles/recipes/source-badge.css +1 -1
  239. package/dist/styles/recipes/spinner.css +12 -1
  240. package/dist/styles/recipes/stepper.css +31 -13
  241. package/dist/styles/recipes/switch.css +68 -23
  242. package/dist/styles/recipes/table-of-contents.css +49 -41
  243. package/dist/styles/recipes/table.css +14 -10
  244. package/dist/styles/recipes/tabs.css +38 -12
  245. package/dist/styles/recipes/task-list.css +7 -14
  246. package/dist/styles/recipes/thread-rail.css +42 -19
  247. package/dist/styles/recipes/timeline.css +2 -0
  248. package/dist/styles/recipes/toolbar.css +27 -25
  249. package/dist/styles/recipes/track-highlight.css +12 -8
  250. package/dist/styles/recipes/transcript-divider.css +2 -2
  251. package/dist/styles/recipes/tree.css +31 -4
  252. package/dist/styles/recipes/user-ask-details.css +0 -1
  253. package/dist/styles/recipes/user-ask.css +4 -4
  254. package/dist/styles/theme.css +287 -107
  255. package/dist/task-list.d.ts +4 -1
  256. package/dist/task-list.js +24 -8
  257. package/dist/thread-rail.d.ts +1 -1
  258. package/dist/thread-rail.js +61 -19
  259. package/dist/transcript-divider.js +2 -1
  260. package/dist/ui/alert.d.ts +3 -1
  261. package/dist/ui/alert.js +14 -8
  262. package/dist/ui/autocomplete.js +7 -1
  263. package/dist/ui/avatar.d.ts +8 -0
  264. package/dist/ui/avatar.js +23 -3
  265. package/dist/ui/badge.js +1 -1
  266. package/dist/ui/breadcrumb.d.ts +27 -0
  267. package/dist/ui/breadcrumb.js +88 -0
  268. package/dist/ui/button.d.ts +2 -1
  269. package/dist/ui/button.js +1 -1
  270. package/dist/ui/calendar.js +2 -2
  271. package/dist/ui/card.d.ts +3 -1
  272. package/dist/ui/card.js +12 -7
  273. package/dist/ui/checkbox-group.js +1 -1
  274. package/dist/ui/checkbox.d.ts +2 -0
  275. package/dist/ui/code-diff.d.ts +1 -1
  276. package/dist/ui/code-diff.js +71 -27
  277. package/dist/ui/code.d.ts +5 -3
  278. package/dist/ui/code.js +27 -28
  279. package/dist/ui/color-picker.d.ts +5 -2
  280. package/dist/ui/color-picker.js +84 -36
  281. package/dist/ui/combobox-disabled-selection.d.ts +1 -2
  282. package/dist/ui/combobox-disabled-selection.js +7 -8
  283. package/dist/ui/combobox.d.ts +5 -23
  284. package/dist/ui/combobox.js +36 -16
  285. package/dist/ui/command.d.ts +8 -2
  286. package/dist/ui/command.js +39 -15
  287. package/dist/ui/context-menu.js +3 -0
  288. package/dist/ui/dialog.d.ts +2 -1
  289. package/dist/ui/dialog.js +3 -22
  290. package/dist/ui/dockable-panel-geometry.d.ts +1 -0
  291. package/dist/ui/dockable-panel-geometry.js +7 -1
  292. package/dist/ui/dockable-panel.d.ts +9 -6
  293. package/dist/ui/dockable-panel.js +81 -33
  294. package/dist/ui/drawer.d.ts +7 -4
  295. package/dist/ui/drawer.js +35 -22
  296. package/dist/ui/dropdown-menu.js +4 -3
  297. package/dist/ui/dropzone.d.ts +5 -3
  298. package/dist/ui/dropzone.js +78 -17
  299. package/dist/ui/emoji-picker.d.ts +18 -0
  300. package/dist/ui/emoji-picker.js +136 -0
  301. package/dist/ui/empty.d.ts +3 -1
  302. package/dist/ui/empty.js +12 -7
  303. package/dist/ui/field.js +1 -1
  304. package/dist/ui/gradient-editor.d.ts +1 -1
  305. package/dist/ui/gradient-editor.js +37 -21
  306. package/dist/ui/infinite-canvas.d.ts +13 -1
  307. package/dist/ui/infinite-canvas.js +139 -20
  308. package/dist/ui/input-group.d.ts +2 -4
  309. package/dist/ui/input-group.js +13 -14
  310. package/dist/ui/input-otp.d.ts +1 -1
  311. package/dist/ui/input-otp.js +32 -15
  312. package/dist/ui/input.js +11 -2
  313. package/dist/ui/item.d.ts +2 -1
  314. package/dist/ui/item.js +11 -7
  315. package/dist/ui/live-status.d.ts +7 -0
  316. package/dist/ui/live-status.js +17 -0
  317. package/dist/ui/markdown-elements.d.ts +6 -0
  318. package/dist/ui/markdown-elements.js +42 -9
  319. package/dist/ui/menubar.js +2 -2
  320. package/dist/ui/morphing-panel.js +2 -1
  321. package/dist/ui/native-select.d.ts +1 -1
  322. package/dist/ui/native-select.js +24 -11
  323. package/dist/ui/number-field.d.ts +1 -1
  324. package/dist/ui/number-field.js +13 -2
  325. package/dist/ui/page-layout.d.ts +2 -2
  326. package/dist/ui/page-layout.js +2 -4
  327. package/dist/ui/pagination.d.ts +7 -5
  328. package/dist/ui/pagination.js +19 -13
  329. package/dist/ui/phone-input.d.ts +1 -0
  330. package/dist/ui/phone-input.js +56 -58
  331. package/dist/ui/radio-group.d.ts +3 -0
  332. package/dist/ui/radio-group.js +11 -1
  333. package/dist/ui/resizable.d.ts +20 -2
  334. package/dist/ui/resizable.js +130 -8
  335. package/dist/ui/responsive-dialog.d.ts +1 -1
  336. package/dist/ui/responsive-dialog.js +9 -23
  337. package/dist/ui/rich-tooltip.d.ts +10 -4
  338. package/dist/ui/rich-tooltip.js +81 -33
  339. package/dist/ui/scroll-area.d.ts +4 -1
  340. package/dist/ui/scroll-area.js +44 -28
  341. package/dist/ui/select.d.ts +2 -1
  342. package/dist/ui/select.js +57 -32
  343. package/dist/ui/sidebar-menu.d.ts +5 -1
  344. package/dist/ui/sidebar-menu.js +31 -33
  345. package/dist/ui/sidebar-provider.d.ts +10 -1
  346. package/dist/ui/sidebar-provider.js +38 -13
  347. package/dist/ui/sidebar-resize-rail.js +7 -3
  348. package/dist/ui/sidebar.d.ts +11 -6
  349. package/dist/ui/sidebar.js +46 -23
  350. package/dist/ui/slider.js +31 -22
  351. package/dist/ui/spinner.d.ts +3 -2
  352. package/dist/ui/spinner.js +3 -2
  353. package/dist/ui/stepper.d.ts +8 -1
  354. package/dist/ui/stepper.js +74 -25
  355. package/dist/ui/switch.d.ts +1 -0
  356. package/dist/ui/table-of-contents.d.ts +5 -4
  357. package/dist/ui/table-of-contents.js +143 -52
  358. package/dist/ui/table.js +15 -9
  359. package/dist/ui/textarea.d.ts +1 -1
  360. package/dist/ui/textarea.js +20 -9
  361. package/dist/ui/timeline.d.ts +3 -1
  362. package/dist/ui/timeline.js +17 -9
  363. package/dist/ui/toast.d.ts +11 -5
  364. package/dist/ui/toast.js +100 -54
  365. package/dist/ui/toggle.d.ts +1 -1
  366. package/dist/ui/toggle.js +2 -1
  367. package/dist/ui/toolbar.d.ts +3 -2
  368. package/dist/ui/toolbar.js +4 -2
  369. package/dist/ui/tooltip.js +3 -20
  370. package/dist/ui/tree.js +120 -80
  371. package/dist/ui/trigger-menu.js +7 -2
  372. package/dist/user-ask.d.ts +10 -5
  373. package/dist/user-ask.js +31 -11
  374. package/package.json +5 -1
  375. package/dist/hooks/use-keyboard-navigation.d.ts +0 -3
  376. package/dist/hooks/use-keyboard-navigation.js +0 -22
@@ -10,13 +10,14 @@ import { jsx, jsxs } from "react/jsx-runtime";
10
10
  import { BotIcon, ChevronRightIcon, CircleIcon, FolderIcon, PlusIcon, SearchIcon } from "lucide-react";
11
11
  //#region src/blocks/coding-agent.tsx
12
12
  function CodingAgentBlock({ appName = "Agent", brand, sidebarTop, navigation = [], projects, activeTaskId, activeTaskTitle = "New task", onNavigationSelect, onTaskSelect, onNewTask, onSearch, headerActions, sidebarFooter, children, layout = "viewport", className, style, ...props }) {
13
- const contained = layout === "contained";
13
+ const Heading = layout === "contained" ? "h2" : "h1";
14
14
  const providerStyle = {
15
15
  "--sidebar-width": "17.5rem",
16
16
  ...style
17
17
  };
18
18
  return /* @__PURE__ */ jsxs(SidebarProvider, {
19
- className: cn("overflow-hidden bg-background text-foreground", contained ? "relative h-full min-h-0" : "h-svh min-h-svh", className),
19
+ layout,
20
+ className: cn("bg-background text-foreground", layout === "viewport" && "h-svh overflow-hidden", className),
20
21
  style: providerStyle,
21
22
  ...props,
22
23
  children: [/* @__PURE__ */ jsx(CodingAgentSidebar, {
@@ -26,7 +27,6 @@ function CodingAgentBlock({ appName = "Agent", brand, sidebarTop, navigation = [
26
27
  navigation,
27
28
  projects,
28
29
  activeTaskId,
29
- contained,
30
30
  sidebarFooter,
31
31
  onNavigationSelect,
32
32
  onTaskSelect,
@@ -39,14 +39,15 @@ function CodingAgentBlock({ appName = "Agent", brand, sidebarTop, navigation = [
39
39
  children: [
40
40
  /* @__PURE__ */ jsx(SidebarTrigger, {
41
41
  size: "xs",
42
- className: "md:hidden"
42
+ className: "lg:hidden"
43
43
  }),
44
44
  /* @__PURE__ */ jsx(FolderIcon, {
45
45
  className: "size-4 shrink-0 text-muted-foreground",
46
46
  "aria-hidden": "true"
47
47
  }),
48
- /* @__PURE__ */ jsx("h1", {
48
+ /* @__PURE__ */ jsx(Heading, {
49
49
  className: "min-w-0 flex-1 truncate text-label font-medium",
50
+ title: activeTaskTitle,
50
51
  children: activeTaskTitle
51
52
  }),
52
53
  headerActions ? /* @__PURE__ */ jsx("div", {
@@ -61,7 +62,7 @@ function CodingAgentBlock({ appName = "Agent", brand, sidebarTop, navigation = [
61
62
  })]
62
63
  });
63
64
  }
64
- function CodingAgentSidebar({ appName, brand, sidebarTop, navigation, projects, activeTaskId, contained, sidebarFooter, onNavigationSelect, onTaskSelect, onNewTask, onSearch }) {
65
+ function CodingAgentSidebar({ appName, brand, sidebarTop, navigation, projects, activeTaskId, sidebarFooter, onNavigationSelect, onTaskSelect, onNewTask, onSearch }) {
65
66
  const { setOpenMobile } = useSidebar();
66
67
  function finishMobileNavigation() {
67
68
  setOpenMobile(false);
@@ -72,7 +73,6 @@ function CodingAgentSidebar({ appName, brand, sidebarTop, navigation, projects,
72
73
  }
73
74
  return /* @__PURE__ */ jsxs(Sidebar, {
74
75
  collapsible: "offcanvas",
75
- className: contained ? "absolute! inset-y-0! h-full border-r border-sidebar-border" : void 0,
76
76
  children: [
77
77
  /* @__PURE__ */ jsxs(SidebarHeader, {
78
78
  className: "gap-1.5 border-b border-sidebar-border px-2 pb-2 pt-3",
@@ -90,16 +90,20 @@ function CodingAgentSidebar({ appName, brand, sidebarTop, navigation, projects,
90
90
  })
91
91
  }), /* @__PURE__ */ jsx("span", {
92
92
  className: "truncate text-label font-semibold",
93
+ title: appName,
93
94
  children: appName
94
95
  })]
95
- }), /* @__PURE__ */ jsx(Button, {
96
+ }), onSearch ? /* @__PURE__ */ jsx(Button, {
96
97
  variant: "ghost",
97
98
  size: "sm",
98
99
  iconOnly: true,
99
100
  "aria-label": "Search tasks",
100
101
  onClick: onSearch,
101
- children: /* @__PURE__ */ jsx(SearchIcon, { className: "size-3.5" })
102
- })]
102
+ children: /* @__PURE__ */ jsx(SearchIcon, {
103
+ className: "size-3.5",
104
+ "aria-hidden": "true"
105
+ })
106
+ }) : null]
103
107
  }),
104
108
  /* @__PURE__ */ jsx(SidebarMenu, { children: /* @__PURE__ */ jsx(SidebarMenuItem, { children: /* @__PURE__ */ jsxs(SidebarMenuButton, {
105
109
  size: "sm",
@@ -120,7 +124,7 @@ function CodingAgentSidebar({ appName, brand, sidebarTop, navigation, projects,
120
124
  item.icon,
121
125
  /* @__PURE__ */ jsx("span", { children: item.label }),
122
126
  item.trailing ? /* @__PURE__ */ jsx("span", {
123
- className: "ml-auto shrink-0",
127
+ className: "ms-auto shrink-0",
124
128
  children: item.trailing
125
129
  }) : null
126
130
  ]
@@ -132,50 +136,43 @@ function CodingAgentSidebar({ appName, brand, sidebarTop, navigation, projects,
132
136
  children: projects.map((project) => /* @__PURE__ */ jsxs(Collapsible, {
133
137
  defaultOpen: project.open ?? true,
134
138
  className: "min-w-0",
135
- children: [/* @__PURE__ */ jsxs(CollapsibleTrigger, {
136
- className: "flex h-[var(--control-h-sm)] w-full items-center gap-2 rounded-[var(--radius-popup-item)] px-2 text-caption font-medium hover:bg-foreground/6",
137
- children: [
138
- /* @__PURE__ */ jsx(ChevronRightIcon, {
139
- className: "size-3.5 shrink-0 text-muted-foreground",
139
+ children: [/* @__PURE__ */ jsxs(CollapsibleTrigger, { children: [
140
+ /* @__PURE__ */ jsx(ChevronRightIcon, {
141
+ className: "size-3.5 shrink-0 text-muted-foreground",
142
+ "aria-hidden": "true"
143
+ }),
144
+ /* @__PURE__ */ jsx("span", {
145
+ className: "flex shrink-0 items-center text-muted-foreground",
146
+ children: project.icon ?? /* @__PURE__ */ jsx(FolderIcon, {
147
+ className: "size-4",
140
148
  "aria-hidden": "true"
141
- }),
142
- /* @__PURE__ */ jsx("span", {
143
- className: "flex shrink-0 items-center text-muted-foreground",
144
- children: project.icon ?? /* @__PURE__ */ jsx(FolderIcon, {
145
- className: "size-4",
146
- "aria-hidden": "true"
147
- })
148
- }),
149
- /* @__PURE__ */ jsx("span", {
150
- className: "truncate",
151
- children: project.name
152
149
  })
153
- ]
154
- }), /* @__PURE__ */ jsx(CollapsibleContent, { children: /* @__PURE__ */ jsx(SidebarMenu, {
155
- className: "mt-1 pl-5",
156
- children: project.tasks.map((task) => {
157
- const isActive = task.id === activeTaskId;
158
- return /* @__PURE__ */ jsx(SidebarMenuItem, { children: /* @__PURE__ */ jsxs(SidebarMenuButton, {
159
- size: "sm",
160
- isActive,
161
- "aria-current": isActive ? "page" : void 0,
162
- onClick: () => {
163
- onTaskSelect?.(task, project);
164
- finishMobileNavigation();
165
- },
166
- children: [
167
- /* @__PURE__ */ jsx(CircleIcon, {
168
- className: "size-1.5 fill-current opacity-35",
169
- "aria-hidden": "true"
170
- }),
171
- /* @__PURE__ */ jsx("span", { children: task.title }),
172
- task.trailing ? /* @__PURE__ */ jsx("span", {
173
- className: "ml-auto shrink-0",
174
- children: task.trailing
175
- }) : null
176
- ]
177
- }) }, task.id);
150
+ }),
151
+ /* @__PURE__ */ jsx("span", {
152
+ className: "truncate",
153
+ children: project.name
178
154
  })
155
+ ] }), /* @__PURE__ */ jsx(CollapsibleContent, { children: /* @__PURE__ */ jsx(SidebarMenu, {
156
+ className: "mt-1 ps-5",
157
+ children: project.tasks.map((task) => /* @__PURE__ */ jsx(SidebarMenuItem, { children: /* @__PURE__ */ jsxs(SidebarMenuButton, {
158
+ size: "sm",
159
+ isActive: task.id === activeTaskId,
160
+ onClick: () => {
161
+ onTaskSelect?.(task, project);
162
+ finishMobileNavigation();
163
+ },
164
+ children: [
165
+ /* @__PURE__ */ jsx(CircleIcon, {
166
+ className: "size-1.5 fill-current opacity-35",
167
+ "aria-hidden": "true"
168
+ }),
169
+ /* @__PURE__ */ jsx("span", { children: task.title }),
170
+ task.trailing ? /* @__PURE__ */ jsx("span", {
171
+ className: "ms-auto shrink-0",
172
+ children: task.trailing
173
+ }) : null
174
+ ]
175
+ }) }, task.id))
179
176
  }) })]
180
177
  }, project.id))
181
178
  })]
@@ -191,7 +188,7 @@ function CodingAgentSidebar({ appName, brand, sidebarTop, navigation, projects,
191
188
  function CodingAgentConversation({ children, composer, className, ...props }) {
192
189
  return /* @__PURE__ */ jsx(ChatLayout, {
193
190
  chrome: "embedded",
194
- className: cn("h-full min-h-0 max-w-none", className),
191
+ className,
195
192
  ...props,
196
193
  children: /* @__PURE__ */ jsx(ChatThread, {
197
194
  composer: /* @__PURE__ */ jsx("div", {
@@ -218,11 +215,11 @@ function CodingAgentEmptyState({ title = "What should we build?", description, i
218
215
  })
219
216
  }),
220
217
  /* @__PURE__ */ jsx("h2", {
221
- className: "text-balance text-xl font-medium tracking-tight sm:text-2xl",
218
+ className: "text-balance text-heading-3 sm:text-heading-2",
222
219
  children: title
223
220
  }),
224
221
  description ? /* @__PURE__ */ jsx("p", {
225
- className: "mt-2 max-w-xl text-sm leading-6 text-muted-foreground",
222
+ className: "mt-2 max-w-xl text-pretty text-body text-muted-foreground",
226
223
  children: description
227
224
  }) : null,
228
225
  suggestions.length > 0 ? /* @__PURE__ */ jsx("div", {
@@ -230,7 +227,7 @@ function CodingAgentEmptyState({ title = "What should we build?", description, i
230
227
  children: suggestions.map((suggestion) => /* @__PURE__ */ jsx(Button, {
231
228
  variant: "surface",
232
229
  size: "lg",
233
- className: "h-auto min-h-28 w-full items-start justify-start whitespace-normal rounded-[var(--radius-panel)] px-4 py-4 text-left",
230
+ className: "h-auto min-h-28 w-full items-start justify-start whitespace-normal rounded-[var(--radius-panel)] px-4 py-4 text-start",
234
231
  onClick: () => onSuggestionSelect?.(suggestion.prompt ?? suggestion.title, suggestion),
235
232
  children: /* @__PURE__ */ jsxs("span", {
236
233
  className: "flex min-w-0 flex-col items-start gap-3",
@@ -240,7 +237,7 @@ function CodingAgentEmptyState({ title = "What should we build?", description, i
240
237
  children: suggestion.icon
241
238
  }),
242
239
  /* @__PURE__ */ jsx("span", {
243
- className: "text-sm font-medium leading-5 text-foreground",
240
+ className: "text-body font-medium text-foreground",
244
241
  children: suggestion.title
245
242
  }),
246
243
  suggestion.description ? /* @__PURE__ */ jsx("span", {
@@ -0,0 +1,32 @@
1
+ //#region src/blocks/design-canvas-data.d.ts
2
+ export type DesignCanvasLayerKind = "frame" | "rectangle" | "ellipse" | "text";
3
+ export type DesignCanvasTool = "move" | DesignCanvasLayerKind;
4
+ export type DesignCanvasFill = {
5
+ color: string;
6
+ opacity: number;
7
+ visible: boolean;
8
+ };
9
+ export type DesignCanvasLayer = {
10
+ id: string;
11
+ name: string;
12
+ kind: DesignCanvasLayerKind;
13
+ x: number;
14
+ y: number;
15
+ width: number;
16
+ height: number;
17
+ rotation: number;
18
+ opacity: number;
19
+ cornerRadius: number;
20
+ fill: DesignCanvasFill | null;
21
+ text?: string;
22
+ };
23
+ export type DesignCanvasPoint = {
24
+ x: number;
25
+ y: number;
26
+ };
27
+ export type DesignCanvasBounds = Pick<DesignCanvasLayer, "x" | "y" | "width" | "height">;
28
+ export declare function drawnDesignCanvasBounds(kind: DesignCanvasLayerKind, start: DesignCanvasPoint, end: DesignCanvasPoint, clickTolerance: number): DesignCanvasBounds;
29
+ export declare function createDesignCanvasLayer(kind: DesignCanvasLayerKind, bounds: DesignCanvasBounds, id: string): DesignCanvasLayer;
30
+ export declare function resizeDesignCanvasLayer(layer: DesignCanvasLayer, size: Partial<Pick<DesignCanvasLayer, "width" | "height">>, aspectRatioLocked: boolean): DesignCanvasLayer;
31
+ export declare function designCanvasFillColor(fill: DesignCanvasFill | null): string;
32
+ //#endregion
@@ -0,0 +1,100 @@
1
+ //#region src/blocks/design-canvas-data.ts
2
+ const NEW_LAYER_DEFAULTS = {
3
+ frame: {
4
+ name: "Frame",
5
+ width: 320,
6
+ height: 200,
7
+ fill: {
8
+ color: "#FFFFFF",
9
+ opacity: 100,
10
+ visible: true
11
+ }
12
+ },
13
+ rectangle: {
14
+ name: "Rectangle",
15
+ width: 120,
16
+ height: 120,
17
+ fill: {
18
+ color: "#D9D9D9",
19
+ opacity: 100,
20
+ visible: true
21
+ }
22
+ },
23
+ ellipse: {
24
+ name: "Ellipse",
25
+ width: 120,
26
+ height: 120,
27
+ fill: {
28
+ color: "#D9D9D9",
29
+ opacity: 100,
30
+ visible: true
31
+ }
32
+ },
33
+ text: {
34
+ name: "Text",
35
+ width: 160,
36
+ height: 32,
37
+ fill: {
38
+ color: "#000000",
39
+ opacity: 100,
40
+ visible: true
41
+ },
42
+ text: "Text"
43
+ }
44
+ };
45
+ function drawnDesignCanvasBounds(kind, start, end, clickTolerance) {
46
+ const width = Math.abs(end.x - start.x);
47
+ const height = Math.abs(end.y - start.y);
48
+ if (Math.max(width, height) < clickTolerance) {
49
+ const defaults = NEW_LAYER_DEFAULTS[kind];
50
+ return {
51
+ x: Math.round(start.x - defaults.width / 2),
52
+ y: Math.round(start.y - defaults.height / 2),
53
+ width: defaults.width,
54
+ height: defaults.height
55
+ };
56
+ }
57
+ return {
58
+ x: Math.round(Math.min(start.x, end.x)),
59
+ y: Math.round(Math.min(start.y, end.y)),
60
+ width: Math.max(1, Math.round(width)),
61
+ height: Math.max(1, Math.round(height))
62
+ };
63
+ }
64
+ function createDesignCanvasLayer(kind, bounds, id) {
65
+ return {
66
+ ...NEW_LAYER_DEFAULTS[kind],
67
+ ...bounds,
68
+ id,
69
+ kind,
70
+ rotation: 0,
71
+ opacity: 100,
72
+ cornerRadius: 0
73
+ };
74
+ }
75
+ function resizeDesignCanvasLayer(layer, size, aspectRatioLocked) {
76
+ const aspectRatio = layer.width / layer.height;
77
+ if (size.width !== void 0) {
78
+ const height = aspectRatioLocked ? Math.round(size.width / aspectRatio) : layer.height;
79
+ return {
80
+ ...layer,
81
+ width: size.width,
82
+ height
83
+ };
84
+ }
85
+ if (size.height !== void 0) {
86
+ const width = aspectRatioLocked ? Math.round(size.height * aspectRatio) : layer.width;
87
+ return {
88
+ ...layer,
89
+ width,
90
+ height: size.height
91
+ };
92
+ }
93
+ return layer;
94
+ }
95
+ function designCanvasFillColor(fill) {
96
+ if (!fill?.visible) return "transparent";
97
+ return `color-mix(in srgb, ${fill.color} ${fill.opacity}%, transparent)`;
98
+ }
99
+ //#endregion
100
+ export { createDesignCanvasLayer, designCanvasFillColor, drawnDesignCanvasBounds, resizeDesignCanvasLayer };
@@ -0,0 +1,8 @@
1
+ import { DesignCanvasLayer } from "./design-canvas-data.js";
2
+ //#region src/blocks/design-canvas-inspector.d.ts
3
+ export type DesignCanvasInspectorProps = {
4
+ layer: DesignCanvasLayer | undefined;
5
+ onLayerChange: (layer: DesignCanvasLayer) => void;
6
+ };
7
+ export declare function DesignCanvasInspector({ layer, onLayerChange }: DesignCanvasInspectorProps): import("react").JSX.Element;
8
+ //#endregion
@@ -0,0 +1,238 @@
1
+ "use client";
2
+ import { Button } from "../ui/button.js";
3
+ import { InputGroup, InputGroupAddon } from "../ui/input-group.js";
4
+ import { resizeDesignCanvasLayer } from "./design-canvas-data.js";
5
+ import { NumberField, NumberFieldGroup, NumberFieldInput, NumberFieldScrubArea } from "../ui/number-field.js";
6
+ import { ColorPicker, ColorPickerArea, ColorPickerContent, ColorPickerEyeDropper, ColorPickerHue, ColorPickerInput, ColorPickerTrigger } from "../ui/color-picker.js";
7
+ import { Empty, EmptyDescription, EmptyHeader, EmptyTitle } from "../ui/empty.js";
8
+ import { Separator } from "../ui/separator.js";
9
+ import { Toggle } from "../ui/toggle.js";
10
+ import { useState } from "react";
11
+ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
12
+ import { BlendIcon, EyeIcon, EyeOffIcon, Link2Icon, MinusIcon, PlusIcon, RotateCwIcon, SquareRoundCornerIcon, Unlink2Icon } from "lucide-react";
13
+ //#region src/blocks/design-canvas-inspector.tsx
14
+ const WHOLE_NUMBER_FORMAT = {
15
+ useGrouping: false,
16
+ maximumFractionDigits: 0
17
+ };
18
+ const DEFAULT_FILL = {
19
+ color: "#D9D9D9",
20
+ opacity: 100,
21
+ visible: true
22
+ };
23
+ function DesignCanvasInspector({ layer, onLayerChange }) {
24
+ const [aspectRatioLocked, setAspectRatioLocked] = useState(false);
25
+ if (!layer) return /* @__PURE__ */ jsx(Empty, {
26
+ className: "h-full",
27
+ children: /* @__PURE__ */ jsxs(EmptyHeader, { children: [/* @__PURE__ */ jsx(EmptyTitle, { children: "Nothing selected" }), /* @__PURE__ */ jsx(EmptyDescription, { children: "Select a layer to edit its position, size, and fill." })] })
28
+ });
29
+ const update = (patch) => onLayerChange({
30
+ ...layer,
31
+ ...patch
32
+ });
33
+ return /* @__PURE__ */ jsxs("div", {
34
+ className: "flex flex-col",
35
+ children: [
36
+ /* @__PURE__ */ jsxs(InspectorSection, {
37
+ title: "Position",
38
+ children: [
39
+ /* @__PURE__ */ jsx(ScrubField, {
40
+ label: "X position",
41
+ prefix: "X",
42
+ value: layer.x,
43
+ onValueChange: (x) => update({ x })
44
+ }),
45
+ /* @__PURE__ */ jsx(ScrubField, {
46
+ label: "Y position",
47
+ prefix: "Y",
48
+ value: layer.y,
49
+ onValueChange: (y) => update({ y })
50
+ }),
51
+ /* @__PURE__ */ jsx(ScrubField, {
52
+ label: "Rotation",
53
+ className: "col-start-1",
54
+ prefix: /* @__PURE__ */ jsx(RotateCwIcon, {}),
55
+ value: layer.rotation,
56
+ min: -360,
57
+ max: 360,
58
+ format: {
59
+ ...WHOLE_NUMBER_FORMAT,
60
+ style: "unit",
61
+ unit: "degree",
62
+ unitDisplay: "narrow"
63
+ },
64
+ onValueChange: (rotation) => update({ rotation })
65
+ })
66
+ ]
67
+ }),
68
+ /* @__PURE__ */ jsxs(InspectorSection, {
69
+ title: "Layout",
70
+ children: [
71
+ /* @__PURE__ */ jsx(ScrubField, {
72
+ label: "Width",
73
+ prefix: "W",
74
+ value: layer.width,
75
+ min: 1,
76
+ onValueChange: (width) => onLayerChange(resizeDesignCanvasLayer(layer, { width }, aspectRatioLocked))
77
+ }),
78
+ /* @__PURE__ */ jsx(ScrubField, {
79
+ label: "Height",
80
+ prefix: "H",
81
+ value: layer.height,
82
+ min: 1,
83
+ onValueChange: (height) => onLayerChange(resizeDesignCanvasLayer(layer, { height }, aspectRatioLocked))
84
+ }),
85
+ /* @__PURE__ */ jsx(Toggle, {
86
+ size: "sm",
87
+ variant: "ghost",
88
+ iconOnly: true,
89
+ "aria-label": "Lock aspect ratio",
90
+ pressed: aspectRatioLocked,
91
+ onPressedChange: setAspectRatioLocked,
92
+ children: aspectRatioLocked ? /* @__PURE__ */ jsx(Link2Icon, {}) : /* @__PURE__ */ jsx(Unlink2Icon, {})
93
+ })
94
+ ]
95
+ }),
96
+ /* @__PURE__ */ jsxs(InspectorSection, {
97
+ title: "Appearance",
98
+ children: [/* @__PURE__ */ jsx(ScrubField, {
99
+ label: "Layer opacity",
100
+ prefix: /* @__PURE__ */ jsx(BlendIcon, {}),
101
+ suffix: "%",
102
+ value: layer.opacity,
103
+ min: 0,
104
+ max: 100,
105
+ onValueChange: (opacity) => update({ opacity })
106
+ }), /* @__PURE__ */ jsx(ScrubField, {
107
+ label: "Corner radius",
108
+ prefix: /* @__PURE__ */ jsx(SquareRoundCornerIcon, {}),
109
+ value: layer.cornerRadius,
110
+ min: 0,
111
+ onValueChange: (cornerRadius) => update({ cornerRadius })
112
+ })]
113
+ }),
114
+ /* @__PURE__ */ jsx(InspectorSection, {
115
+ title: "Fill",
116
+ action: layer.fill ? null : /* @__PURE__ */ jsx(Button, {
117
+ size: "xs",
118
+ variant: "ghost",
119
+ iconOnly: true,
120
+ "aria-label": "Add fill",
121
+ onClick: () => update({ fill: DEFAULT_FILL }),
122
+ children: /* @__PURE__ */ jsx(PlusIcon, {})
123
+ }),
124
+ children: layer.fill ? /* @__PURE__ */ jsx(FillRow, {
125
+ fill: layer.fill,
126
+ onFillChange: (fill) => update({ fill }),
127
+ onRemove: () => update({ fill: null })
128
+ }) : null
129
+ })
130
+ ]
131
+ });
132
+ }
133
+ function InspectorSection({ title, action, children }) {
134
+ return /* @__PURE__ */ jsxs("section", {
135
+ "aria-label": title,
136
+ className: "flex flex-col gap-2 border-b px-3 py-3",
137
+ children: [/* @__PURE__ */ jsxs("header", {
138
+ className: "flex h-6 items-center justify-between",
139
+ children: [/* @__PURE__ */ jsx("h3", {
140
+ className: "text-caption font-medium",
141
+ children: title
142
+ }), action]
143
+ }), /* @__PURE__ */ jsx("div", {
144
+ className: "grid grid-cols-[minmax(0,1fr)_minmax(0,1fr)_auto] items-center gap-2 empty:hidden",
145
+ children
146
+ })]
147
+ });
148
+ }
149
+ function ScrubField({ label, className, prefix, suffix, value, onValueChange, min, max, format = WHOLE_NUMBER_FORMAT }) {
150
+ return /* @__PURE__ */ jsx(NumberField, {
151
+ size: "sm",
152
+ className,
153
+ value,
154
+ min,
155
+ max,
156
+ format,
157
+ onValueChange: (next) => {
158
+ if (next !== null) onValueChange(next);
159
+ },
160
+ children: /* @__PURE__ */ jsxs(NumberFieldGroup, {
161
+ className: "w-full",
162
+ children: [
163
+ prefix ? /* @__PURE__ */ jsx(NumberFieldScrubArea, { children: prefix }) : null,
164
+ /* @__PURE__ */ jsx(NumberFieldInput, { "aria-label": label }),
165
+ suffix ? /* @__PURE__ */ jsx(NumberFieldScrubArea, { children: suffix }) : null
166
+ ]
167
+ })
168
+ });
169
+ }
170
+ function FillRow({ fill, onFillChange, onRemove }) {
171
+ return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsxs(ColorPicker, {
172
+ value: fill.color,
173
+ alpha: false,
174
+ onValueChange: (color) => onFillChange({
175
+ ...fill,
176
+ color
177
+ }),
178
+ children: [/* @__PURE__ */ jsxs(InputGroup, {
179
+ size: "sm",
180
+ className: "col-span-2",
181
+ children: [
182
+ /* @__PURE__ */ jsx(InputGroupAddon, { children: /* @__PURE__ */ jsx(ColorPickerTrigger, { "aria-label": "Choose fill color" }) }),
183
+ /* @__PURE__ */ jsx(ColorPickerInput, { "aria-label": "Fill color" }),
184
+ /* @__PURE__ */ jsx(Separator, {
185
+ orientation: "vertical",
186
+ className: "h-4"
187
+ }),
188
+ /* @__PURE__ */ jsx(NumberField, {
189
+ value: fill.opacity,
190
+ min: 0,
191
+ max: 100,
192
+ format: WHOLE_NUMBER_FORMAT,
193
+ className: "shrink-0",
194
+ onValueChange: (opacity) => {
195
+ if (opacity !== null) onFillChange({
196
+ ...fill,
197
+ opacity
198
+ });
199
+ },
200
+ children: /* @__PURE__ */ jsxs(NumberFieldGroup, {
201
+ className: "w-full",
202
+ children: [/* @__PURE__ */ jsx(NumberFieldInput, { "aria-label": "Fill opacity" }), /* @__PURE__ */ jsx(NumberFieldScrubArea, { children: "%" })]
203
+ })
204
+ })
205
+ ]
206
+ }), /* @__PURE__ */ jsxs(ColorPickerContent, {
207
+ side: "left",
208
+ align: "start",
209
+ children: [/* @__PURE__ */ jsx(ColorPickerArea, {}), /* @__PURE__ */ jsxs("div", {
210
+ className: "flex items-center gap-2",
211
+ children: [/* @__PURE__ */ jsx(ColorPickerEyeDropper, {}), /* @__PURE__ */ jsx(ColorPickerHue, { className: "flex-1" })]
212
+ })]
213
+ })]
214
+ }), /* @__PURE__ */ jsxs("div", {
215
+ className: "flex",
216
+ children: [/* @__PURE__ */ jsx(Toggle, {
217
+ size: "sm",
218
+ variant: "ghost",
219
+ iconOnly: true,
220
+ "aria-label": "Show fill",
221
+ pressed: fill.visible,
222
+ onPressedChange: (visible) => onFillChange({
223
+ ...fill,
224
+ visible
225
+ }),
226
+ children: fill.visible ? /* @__PURE__ */ jsx(EyeIcon, {}) : /* @__PURE__ */ jsx(EyeOffIcon, {})
227
+ }), /* @__PURE__ */ jsx(Button, {
228
+ size: "sm",
229
+ variant: "ghost",
230
+ iconOnly: true,
231
+ "aria-label": "Remove fill",
232
+ onClick: onRemove,
233
+ children: /* @__PURE__ */ jsx(MinusIcon, {})
234
+ })]
235
+ })] });
236
+ }
237
+ //#endregion
238
+ export { DesignCanvasInspector };
@@ -0,0 +1,21 @@
1
+ import { DesignCanvasFill, DesignCanvasLayer, DesignCanvasLayerKind, DesignCanvasTool } from "./design-canvas-data.js";
2
+ import { InfiniteCanvasTransform } from "../ui/infinite-canvas.js";
3
+ import { ComponentProps } from "react";
4
+ //#region src/blocks/design-canvas.d.ts
5
+ export type DesignCanvasBlockProps = Omit<ComponentProps<"div">, "children" | "defaultValue" | "onChange"> & {
6
+ layers?: readonly DesignCanvasLayer[];
7
+ defaultLayers?: readonly DesignCanvasLayer[];
8
+ onLayersChange?: (layers: DesignCanvasLayer[]) => void;
9
+ selectedLayerId?: string | null;
10
+ defaultSelectedLayerId?: string | null;
11
+ onSelectedLayerIdChange?: (layerId: string | null) => void;
12
+ defaultTransform?: InfiniteCanvasTransform;
13
+ layout?: "viewport" | "contained";
14
+ layersLabel?: string;
15
+ propertiesLabel?: string;
16
+ openLayersLabel?: string;
17
+ openPropertiesLabel?: string;
18
+ };
19
+ export declare function DesignCanvasBlock({ layers, defaultLayers, onLayersChange, selectedLayerId, defaultSelectedLayerId, onSelectedLayerIdChange, defaultTransform, layout, layersLabel, propertiesLabel, openLayersLabel, openPropertiesLabel, className, ...props }: DesignCanvasBlockProps): import("react").JSX.Element;
20
+ //#endregion
21
+ export type { DesignCanvasFill, DesignCanvasLayer, DesignCanvasLayerKind, DesignCanvasTool };