@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
package/dist/ui/dialog.js CHANGED
@@ -3,6 +3,7 @@ import { cn } from "../lib/cn.js";
3
3
  import { controlEffectsAttribute, skinAdornment } from "../skin.js";
4
4
  import { useSkin } from "../skin-provider.js";
5
5
  import { Button } from "./button.js";
6
+ import { PopupCloseButton } from "../popup-parts.js";
6
7
  import { jsx, jsxs } from "react/jsx-runtime";
7
8
  import { Dialog as Dialog$1 } from "@base-ui/react/dialog";
8
9
  //#region src/ui/dialog.tsx
@@ -33,7 +34,7 @@ function DialogClose({ className, children, variant = "surface", size = "sm", to
33
34
  })
34
35
  });
35
36
  }
36
- function DialogContent({ className, children, showCloseButton = true, ...props }) {
37
+ function DialogContent({ className, children, showCloseButton = true, closeLabel = "Close", ...props }) {
37
38
  const skin = useSkin();
38
39
  return /* @__PURE__ */ jsxs(Dialog$1.Portal, { children: [/* @__PURE__ */ jsx(Dialog$1.Backdrop, {
39
40
  "data-control-ui": "dialog",
@@ -58,27 +59,7 @@ function DialogContent({ className, children, showCloseButton = true, ...props }
58
59
  children: [
59
60
  skinAdornment(skin, "dialog", "titlebar", {}),
60
61
  children,
61
- showCloseButton ? /* @__PURE__ */ jsxs(DialogClose, {
62
- variant: "ghost",
63
- size: "xs",
64
- iconOnly: true,
65
- className: "absolute",
66
- children: [/* @__PURE__ */ jsx("svg", {
67
- viewBox: "0 0 16 16",
68
- className: "size-4",
69
- "aria-hidden": "true",
70
- fill: "none",
71
- children: /* @__PURE__ */ jsx("path", {
72
- d: "M4 4 12 12M12 4 4 12",
73
- stroke: "currentColor",
74
- strokeWidth: "1.4",
75
- strokeLinecap: "round"
76
- })
77
- }), /* @__PURE__ */ jsx("span", {
78
- className: "sr-only",
79
- children: "Close"
80
- })]
81
- }) : null
62
+ showCloseButton ? /* @__PURE__ */ jsx(Dialog$1.Close, { render: /* @__PURE__ */ jsx(PopupCloseButton, { label: closeLabel }) }) : null
82
63
  ]
83
64
  })] });
84
65
  }
@@ -14,4 +14,5 @@ export type DockablePanelPosition = {
14
14
  export declare function clampDockablePanelPosition(position: DockablePanelPosition, bounds: DockablePanelBounds, panel: DockablePanelSize, inset?: number): DockablePanelPosition;
15
15
  export declare function dockablePanelSideAt(pointerX: number, width: number): "left" | "right";
16
16
  export declare function oppositeDockablePanelSide(placement: "left" | "right"): "left" | "right";
17
+ export declare function dockablePanelSideForKey(key: string, placement: "left" | "right"): "left" | "right" | null;
17
18
  //#endregion
@@ -13,5 +13,11 @@ function dockablePanelSideAt(pointerX, width) {
13
13
  function oppositeDockablePanelSide(placement) {
14
14
  return placement === "left" ? "right" : "left";
15
15
  }
16
+ function dockablePanelSideForKey(key, placement) {
17
+ if (key === "ArrowLeft") return "left";
18
+ if (key === "ArrowRight") return "right";
19
+ if (key === "Enter" || key === " ") return oppositeDockablePanelSide(placement);
20
+ return null;
21
+ }
16
22
  //#endregion
17
- export { clampDockablePanelPosition, dockablePanelSideAt, oppositeDockablePanelSide };
23
+ export { clampDockablePanelPosition, dockablePanelSideAt, dockablePanelSideForKey, oppositeDockablePanelSide };
@@ -1,6 +1,6 @@
1
1
  import { ButtonKnobStyle } from "../knob-contracts/button-knobs.js";
2
2
  import { DockablePanelKnobStyle } from "../knob-contracts/dockable-panel-knobs.js";
3
- import { CSSProperties, ComponentProps, ReactNode } from "react";
3
+ import { CSSProperties, ComponentProps, ReactNode, RefObject } from "react";
4
4
  //#region src/ui/dockable-panel.d.ts
5
5
  export type DockablePanelPlacement = "left" | "right";
6
6
  export type DockablePanelProps = Omit<ComponentProps<"aside">, "onChange" | "ref" | "style"> & {
@@ -10,15 +10,18 @@ export type DockablePanelProps = Omit<ComponentProps<"aside">, "onChange" | "ref
10
10
  placement?: DockablePanelPlacement;
11
11
  defaultPlacement?: DockablePanelPlacement;
12
12
  onPlacementChange?: (placement: DockablePanelPlacement) => void;
13
+ finalFocus?: RefObject<HTMLElement | null>;
13
14
  style?: CSSProperties & DockablePanelKnobStyle;
14
15
  };
15
16
  export type DockablePanelHeaderProps = Omit<ComponentProps<"div">, "style"> & {
16
17
  style?: CSSProperties & DockablePanelKnobStyle;
17
18
  };
18
- export type DockablePanelDragHandleProps = Omit<ComponentProps<"button">, "style"> & {
19
+ export type DockablePanelDragHandleProps = Omit<ComponentProps<"div">, "style"> & {
20
+ dragLabel?: string;
21
+ dockHintLabel?: string;
19
22
  style?: CSSProperties & DockablePanelKnobStyle;
20
23
  };
21
- export type DockablePanelTitleProps = Omit<ComponentProps<"h2">, "style"> & {
24
+ export type DockablePanelTitleProps = Omit<ComponentProps<"h2">, "style" | "id"> & {
22
25
  style?: CSSProperties & DockablePanelKnobStyle;
23
26
  };
24
27
  export type DockablePanelActionsProps = ComponentProps<"div"> & {
@@ -45,10 +48,10 @@ export type DockablePanelContentProps = ComponentProps<"div"> & {
45
48
  padding?: DockablePanelContentPadding;
46
49
  style?: CSSProperties & DockablePanelKnobStyle;
47
50
  };
48
- export declare function DockablePanel({ open: openProp, defaultOpen, onOpenChange, placement: placementProp, defaultPlacement, onPlacementChange, className, style, children, "aria-label": ariaLabel, ...props }: DockablePanelProps): import("react").JSX.Element | null;
51
+ export declare function DockablePanel({ open: openProp, defaultOpen, onOpenChange, placement: placementProp, defaultPlacement, onPlacementChange, finalFocus, className, style, children, "aria-label": ariaLabel, ...props }: DockablePanelProps): import("react").JSX.Element | null;
49
52
  export declare function DockablePanelHeader({ className, ...props }: DockablePanelHeaderProps): import("react").JSX.Element;
50
- export declare function DockablePanelDragHandle({ className, onPointerDown, onPointerMove, onPointerUp, onPointerCancel, children, ...props }: DockablePanelDragHandleProps): import("react").JSX.Element;
51
- export declare function DockablePanelTitle({ className, ...props }: DockablePanelTitleProps): import("react").JSX.Element;
53
+ export declare function DockablePanelDragHandle({ className, onPointerDown, onPointerMove, onPointerUp, onPointerCancel, children, dragLabel, dockHintLabel, ...props }: DockablePanelDragHandleProps): import("react").JSX.Element;
54
+ export declare function DockablePanelTitle({ className, children, ...props }: DockablePanelTitleProps): import("react").JSX.Element;
52
55
  export declare function DockablePanelActions({ className, ...props }: DockablePanelActionsProps): import("react").JSX.Element;
53
56
  export declare function DockablePanelToggle({ className, children, "aria-label": ariaLabel, onClick, ...props }: DockablePanelToggleProps): import("react").JSX.Element | null;
54
57
  export declare function DockablePanelDock({ placement: nextPlacement, className, children, "aria-label": ariaLabel, onClick, ...props }: DockablePanelDockProps): import("react").JSX.Element | null;
@@ -1,10 +1,12 @@
1
1
  "use client";
2
2
  import { cn } from "../lib/cn.js";
3
3
  import { Button } from "./button.js";
4
+ import { LiveStatus } from "./live-status.js";
5
+ import { ScrollArea } from "./scroll-area.js";
4
6
  import { useIsMobile } from "../hooks/use-mobile.js";
5
- import { clampDockablePanelPosition, dockablePanelSideAt, oppositeDockablePanelSide } from "./dockable-panel-geometry.js";
6
- import { Drawer, DrawerContent } from "./drawer.js";
7
- import { createContext, use, useRef, useState } from "react";
7
+ import { Drawer, DrawerBody, DrawerContent } from "./drawer.js";
8
+ import { clampDockablePanelPosition, dockablePanelSideAt, dockablePanelSideForKey, oppositeDockablePanelSide } from "./dockable-panel-geometry.js";
9
+ import { createContext, use, useEffect, useEffectEvent, useId, useRef, useState } from "react";
8
10
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
9
11
  //#region src/ui/dockable-panel.tsx
10
12
  const DockablePanelContext = createContext(null);
@@ -22,24 +24,43 @@ function useControllableState(controlled, defaultValue, onChange) {
22
24
  }
23
25
  return [value, setValue];
24
26
  }
25
- function DockablePanel({ open: openProp, defaultOpen = true, onOpenChange, placement: placementProp, defaultPlacement = "right", onPlacementChange, className, style, children, "aria-label": ariaLabel = "Dockable panel", ...props }) {
27
+ function DockablePanel({ open: openProp, defaultOpen = true, onOpenChange, placement: placementProp, defaultPlacement = "right", onPlacementChange, finalFocus, className, style, children, "aria-label": ariaLabel = "Dockable panel", ...props }) {
26
28
  const [open, setOpen] = useControllableState(openProp, defaultOpen, onOpenChange);
27
29
  const [placement, setPlacementState] = useControllableState(placementProp, defaultPlacement, onPlacementChange);
28
30
  const [dragging, setDragging] = useState(false);
29
31
  const [potentialDock, setPotentialDock] = useState(placement);
30
32
  const [dragPosition, setDragPosition] = useState(null);
31
33
  const [dragHeight, setDragHeight] = useState(0);
34
+ const [announcement, setAnnouncement] = useState("");
32
35
  const isMobile = useIsMobile();
36
+ const titleId = useId();
33
37
  const panelRef = useRef(null);
34
38
  const potentialDockRef = useRef(placement);
35
39
  const dragRef = useRef(null);
40
+ const returnFocusRef = useRef(null);
41
+ const restoreFocusRef = useRef(false);
42
+ const restoreFocus = useEffectEvent(() => {
43
+ const target = finalFocus?.current ?? returnFocusRef.current;
44
+ if (target instanceof HTMLElement && target.isConnected) target.focus();
45
+ });
46
+ useEffect(() => {
47
+ if (open) {
48
+ returnFocusRef.current = document.activeElement;
49
+ return;
50
+ }
51
+ if (!restoreFocusRef.current) return;
52
+ restoreFocusRef.current = false;
53
+ restoreFocus();
54
+ }, [open]);
36
55
  function setPlacement(next) {
37
56
  setPlacementState(next);
57
+ setAnnouncement(`Panel docked ${next}.`);
38
58
  }
39
59
  function togglePlacement() {
40
60
  setPlacement(oppositeDockablePanelSide(placement));
41
61
  }
42
62
  function close() {
63
+ restoreFocusRef.current = panelRef.current?.contains(document.activeElement) ?? false;
43
64
  setOpen(false);
44
65
  }
45
66
  function finishDrag(event, shouldDock) {
@@ -102,11 +123,11 @@ function DockablePanel({ open: openProp, defaultOpen = true, onOpenChange, place
102
123
  }
103
124
  const context = {
104
125
  close,
105
- dragging,
106
126
  isMobile,
107
127
  placement,
108
128
  setPlacement,
109
129
  togglePlacement,
130
+ titleId,
110
131
  dragHandleProps: {
111
132
  onPointerDown,
112
133
  onPointerMove,
@@ -128,14 +149,16 @@ function DockablePanel({ open: openProp, defaultOpen = true, onOpenChange, place
128
149
  children: /* @__PURE__ */ jsx(DrawerContent, {
129
150
  "data-dockable-panel-root": "",
130
151
  "data-placement": placement,
131
- padding: "none",
132
152
  variant: "floating",
133
153
  surface: "card",
134
154
  "aria-label": ariaLabel,
135
155
  className: cn("max-h-[min(82vh,42rem)] gap-0 overflow-hidden", className),
136
156
  style,
137
157
  ...props,
138
- children
158
+ children: /* @__PURE__ */ jsx(DrawerBody, {
159
+ padding: "none",
160
+ children
161
+ })
139
162
  })
140
163
  })
141
164
  });
@@ -165,15 +188,7 @@ function DockablePanel({ open: openProp, defaultOpen = true, onOpenChange, place
165
188
  transform: `translate3d(${dragPosition.x}px, ${dragPosition.y}px, 0)`
166
189
  } : style,
167
190
  ...props,
168
- children: [children, /* @__PURE__ */ jsxs("span", {
169
- className: "sr-only",
170
- "aria-live": "polite",
171
- children: [
172
- "Panel docked ",
173
- placement,
174
- "."
175
- ]
176
- })]
191
+ children: [children, /* @__PURE__ */ jsx(LiveStatus, { message: announcement })]
177
192
  })]
178
193
  });
179
194
  }
@@ -186,23 +201,28 @@ function DockablePanelHeader({ className, ...props }) {
186
201
  ...props
187
202
  });
188
203
  }
189
- function DockablePanelDragHandle({ className, onPointerDown, onPointerMove, onPointerUp, onPointerCancel, children, ...props }) {
204
+ function DockablePanelDragHandle({ className, onPointerDown, onPointerMove, onPointerUp, onPointerCancel, children, dragLabel = "Drag panel", dockHintLabel = "Drag, or use arrow keys to dock", ...props }) {
190
205
  const context = useDockablePanelContext();
206
+ const hintId = useId();
191
207
  if (context.isMobile) return /* @__PURE__ */ jsx("div", {
192
208
  "data-control-ui": "dockable-panel",
193
209
  "data-control-family": "dockable-panel",
194
210
  "data-slot": "drag-handle",
195
211
  className: cn("flex min-w-0 flex-1 items-center self-stretch", className),
212
+ ...props,
196
213
  children
197
214
  });
198
- return /* @__PURE__ */ jsx("button", {
199
- type: "button",
215
+ function dockWithKeyboard(event) {
216
+ const next = dockablePanelSideForKey(event.key, context.placement);
217
+ if (!next) return;
218
+ event.preventDefault();
219
+ if (!event.repeat) context.setPlacement(next);
220
+ }
221
+ return /* @__PURE__ */ jsxs("div", {
200
222
  "data-control-ui": "dockable-panel",
201
223
  "data-control-family": "dockable-panel",
202
224
  "data-slot": "drag-handle",
203
- "aria-label": "Drag panel",
204
- "aria-pressed": context.dragging,
205
- className: cn("flex min-w-0 flex-1 cursor-grab touch-none items-center self-stretch active:cursor-grabbing", className),
225
+ className: cn("relative flex min-w-0 flex-1 cursor-grab touch-none items-center self-stretch active:cursor-grabbing", className),
206
226
  onPointerDown: (event) => {
207
227
  onPointerDown?.(event);
208
228
  if (!event.defaultPrevented) context.dragHandleProps.onPointerDown(event);
@@ -220,16 +240,39 @@ function DockablePanelDragHandle({ className, onPointerDown, onPointerMove, onPo
220
240
  if (!event.defaultPrevented) context.dragHandleProps.onPointerCancel(event);
221
241
  },
222
242
  ...props,
223
- children
243
+ children: [
244
+ children,
245
+ /* @__PURE__ */ jsx("button", {
246
+ type: "button",
247
+ "data-control-ui": "dockable-panel",
248
+ "data-control-family": "dockable-panel",
249
+ "data-slot": "drag-button",
250
+ "aria-label": dragLabel,
251
+ "aria-labelledby": context.titleId,
252
+ "aria-describedby": hintId,
253
+ "aria-keyshortcuts": "ArrowLeft ArrowRight Enter Space",
254
+ className: "pointer-events-none absolute inset-0",
255
+ onKeyDown: dockWithKeyboard
256
+ }),
257
+ /* @__PURE__ */ jsx("span", {
258
+ id: hintId,
259
+ hidden: true,
260
+ children: dockHintLabel
261
+ })
262
+ ]
224
263
  });
225
264
  }
226
- function DockablePanelTitle({ className, ...props }) {
265
+ function DockablePanelTitle({ className, children, ...props }) {
266
+ const { titleId } = useDockablePanelContext();
227
267
  return /* @__PURE__ */ jsx("h2", {
228
268
  "data-control-ui": "dockable-panel",
229
269
  "data-control-family": "dockable-panel",
230
270
  "data-slot": "title",
231
271
  className: cn("truncate", className),
232
- ...props
272
+ title: typeof children === "string" ? children : void 0,
273
+ ...props,
274
+ id: titleId,
275
+ children
233
276
  });
234
277
  }
235
278
  function DockablePanelActions({ className, ...props }) {
@@ -237,7 +280,7 @@ function DockablePanelActions({ className, ...props }) {
237
280
  "data-control-ui": "dockable-panel",
238
281
  "data-control-family": "dockable-panel",
239
282
  "data-slot": "actions",
240
- className: cn("ml-auto flex shrink-0 items-center", className),
283
+ className: cn("ms-auto flex shrink-0 items-center", className),
241
284
  ...props
242
285
  });
243
286
  }
@@ -303,13 +346,18 @@ function DockablePanelClose({ className, children, "aria-label": ariaLabel = "Cl
303
346
  });
304
347
  }
305
348
  function DockablePanelContent({ padding = "default", className, ...props }) {
306
- return /* @__PURE__ */ jsx("div", {
307
- "data-control-ui": "dockable-panel",
308
- "data-control-family": "dockable-panel",
309
- "data-slot": "content",
310
- "data-padding": padding,
311
- className: cn("min-h-0 flex-1 overflow-y-auto", className),
312
- ...props
349
+ return /* @__PURE__ */ jsx(ScrollArea, {
350
+ className: "flex min-h-0 flex-1 flex-col",
351
+ viewportClassName: "min-h-0 flex-1",
352
+ lockAxis: "x",
353
+ children: /* @__PURE__ */ jsx("div", {
354
+ "data-control-ui": "dockable-panel",
355
+ "data-control-family": "dockable-panel",
356
+ "data-slot": "content",
357
+ "data-padding": padding,
358
+ className,
359
+ ...props
360
+ })
313
361
  });
314
362
  }
315
363
  function DockablePanelDropZone({ side, active, style }) {
@@ -4,8 +4,8 @@ import { Drawer as Drawer$1 } from "@base-ui/react/drawer";
4
4
  //#region src/ui/drawer.d.ts
5
5
  export declare const drawerSides: readonly ["bottom", "top", "right", "left"];
6
6
  export type DrawerSide = (typeof drawerSides)[number];
7
- export declare const drawerContentPaddings: readonly ["default", "none"];
8
- export type DrawerContentPadding = (typeof drawerContentPaddings)[number];
7
+ export declare const drawerBodyPaddings: readonly ["default", "none"];
8
+ export type DrawerBodyPadding = (typeof drawerBodyPaddings)[number];
9
9
  export declare const drawerContentSurfaces: readonly ["background", "card"];
10
10
  export type DrawerContentSurface = (typeof drawerContentSurfaces)[number];
11
11
  export declare const drawerContentVariants: readonly ["edge", "floating"];
@@ -19,9 +19,8 @@ export declare function DrawerTrigger({ className, ...props }: ComponentProps<ty
19
19
  export declare function DrawerClose({ className, ...props }: ComponentProps<typeof Drawer$1.Close> & {
20
20
  style?: CSSProperties & PopupKnobStyle;
21
21
  }): import("react").JSX.Element;
22
- export declare function DrawerContent({ className, children, side, padding, surface, variant, style, ...props }: Omit<ComponentProps<typeof Drawer$1.Popup>, "style"> & {
22
+ export declare function DrawerContent({ className, children, side, surface, variant, style, ...props }: Omit<ComponentProps<typeof Drawer$1.Popup>, "style"> & {
23
23
  side?: DrawerSide;
24
- padding?: DrawerContentPadding;
25
24
  surface?: DrawerContentSurface;
26
25
  variant?: DrawerContentVariant;
27
26
  style?: CSSProperties & PopupKnobStyle;
@@ -29,6 +28,10 @@ export declare function DrawerContent({ className, children, side, padding, surf
29
28
  export declare function DrawerHeader({ className, ...props }: ComponentProps<"div"> & {
30
29
  style?: CSSProperties & PopupKnobStyle;
31
30
  }): import("react").JSX.Element;
31
+ export declare function DrawerBody({ className, padding, ...props }: Omit<ComponentProps<typeof Drawer$1.Content>, "style"> & {
32
+ padding?: DrawerBodyPadding;
33
+ style?: CSSProperties & PopupKnobStyle;
34
+ }): import("react").JSX.Element;
32
35
  export declare function DrawerFooter({ className, ...props }: ComponentProps<"div"> & {
33
36
  style?: CSSProperties & PopupKnobStyle;
34
37
  }): import("react").JSX.Element;
package/dist/ui/drawer.js CHANGED
@@ -2,6 +2,7 @@
2
2
  import { cn } from "../lib/cn.js";
3
3
  import { controlEffectsAttribute } from "../skin.js";
4
4
  import { useSkin } from "../skin-provider.js";
5
+ import { createContext, useContext } from "react";
5
6
  import { jsx, jsxs } from "react/jsx-runtime";
6
7
  import { Drawer as Drawer$1 } from "@base-ui/react/drawer";
7
8
  //#region src/ui/drawer.tsx
@@ -11,7 +12,7 @@ const drawerSides = [
11
12
  "right",
12
13
  "left"
13
14
  ];
14
- const drawerContentPaddings = ["default", "none"];
15
+ const drawerBodyPaddings = ["default", "none"];
15
16
  const drawerContentSurfaces = ["background", "card"];
16
17
  const drawerContentVariants = ["edge", "floating"];
17
18
  const swipeFor = {
@@ -58,11 +59,16 @@ const placement = {
58
59
  }
59
60
  }
60
61
  };
62
+ const DrawerModalContext = createContext(true);
61
63
  function Drawer(props) {
62
- const { side = "bottom", swipeDirection, ...rest } = props;
63
- return /* @__PURE__ */ jsx(Drawer$1.Root, {
64
- swipeDirection: swipeDirection ?? swipeFor[side],
65
- ...rest
64
+ const { side = "bottom", swipeDirection, modal = true, ...rest } = props;
65
+ return /* @__PURE__ */ jsx(DrawerModalContext, {
66
+ value: modal === true,
67
+ children: /* @__PURE__ */ jsx(Drawer$1.Root, {
68
+ swipeDirection: swipeDirection ?? swipeFor[side],
69
+ modal,
70
+ ...rest
71
+ })
66
72
  });
67
73
  }
68
74
  function DrawerTrigger({ className, ...props }) {
@@ -83,11 +89,15 @@ function DrawerClose({ className, ...props }) {
83
89
  ...props
84
90
  });
85
91
  }
86
- function DrawerContent({ className, children, side = "bottom", padding = "default", surface = "background", variant = "edge", style, ...props }) {
92
+ function DrawerContent({ className, children, side = "bottom", surface = "background", variant = "edge", style, ...props }) {
87
93
  const skin = useSkin();
94
+ const modal = useContext(DrawerModalContext);
88
95
  const place = placement[variant][side];
89
96
  const grabbable = side === "bottom" || side === "top";
90
- const backdropStyle = style ? { "--cui-popup-backdrop-background": style["--cui-popup-backdrop-background"] } : void 0;
97
+ const backdropStyle = style ? {
98
+ "--cui-popup-backdrop-background": style["--cui-popup-backdrop-background"],
99
+ "--cui-popup-backdrop-blur": style["--cui-popup-backdrop-blur"]
100
+ } : void 0;
91
101
  return /* @__PURE__ */ jsxs(Drawer$1.Portal, { children: [/* @__PURE__ */ jsx(Drawer$1.Backdrop, {
92
102
  "data-control-ui": "drawer",
93
103
  "data-control-family": "popup",
@@ -96,7 +106,7 @@ function DrawerContent({ className, children, side = "bottom", padding = "defaul
96
106
  "data-slot": "backdrop",
97
107
  "data-skin": skin.id,
98
108
  "data-effects": controlEffectsAttribute(skin.effects),
99
- className: "fixed inset-0 z-(--z-overlay)",
109
+ className: cn("fixed inset-0 z-(--z-overlay)", !modal && "pointer-events-none"),
100
110
  style: backdropStyle
101
111
  }), /* @__PURE__ */ jsx(Drawer$1.Viewport, {
102
112
  "data-control-ui": "drawer",
@@ -107,7 +117,7 @@ function DrawerContent({ className, children, side = "bottom", padding = "defaul
107
117
  "data-variant": variant,
108
118
  "data-skin": skin.id,
109
119
  "data-effects": controlEffectsAttribute(skin.effects),
110
- className: cn("fixed inset-0 z-(--z-modal) flex", place.viewport),
120
+ className: cn("fixed inset-0 z-(--z-modal) flex", place.viewport, !modal && "pointer-events-none"),
111
121
  children: /* @__PURE__ */ jsxs(Drawer$1.Popup, {
112
122
  "data-control-ui": "drawer",
113
123
  "data-control-family": "popup",
@@ -116,10 +126,9 @@ function DrawerContent({ className, children, side = "bottom", padding = "defaul
116
126
  "data-slot": "content",
117
127
  "data-side": side,
118
128
  "data-surface": "modal",
119
- "data-padding": padding,
120
129
  "data-surface-variant": surface,
121
130
  "data-variant": variant,
122
- className: cn("flex flex-col", place.popup, className),
131
+ className: cn("flex flex-col", place.popup, !modal && "pointer-events-auto", className),
123
132
  style,
124
133
  ...props,
125
134
  children: [grabbable ? /* @__PURE__ */ jsx("div", {
@@ -128,14 +137,7 @@ function DrawerContent({ className, children, side = "bottom", padding = "defaul
128
137
  "data-popup-kind": "drawer",
129
138
  "data-slot": "handle",
130
139
  className: "shrink-0"
131
- }) : null, /* @__PURE__ */ jsx(Drawer$1.Content, {
132
- "data-control-ui": "drawer",
133
- "data-control-family": "popup",
134
- "data-popup-kind": "drawer",
135
- "data-slot": "scroll",
136
- className: "flex min-h-0 flex-1 flex-col overflow-y-auto",
137
- children
138
- })]
140
+ }) : null, children]
139
141
  })
140
142
  })] });
141
143
  }
@@ -145,7 +147,18 @@ function DrawerHeader({ className, ...props }) {
145
147
  "data-control-family": "popup",
146
148
  "data-popup-kind": "drawer",
147
149
  "data-slot": "header",
148
- className: cn("flex flex-col", className),
150
+ className: cn("flex shrink-0 flex-col", className),
151
+ ...props
152
+ });
153
+ }
154
+ function DrawerBody({ className, padding = "default", ...props }) {
155
+ return /* @__PURE__ */ jsx(Drawer$1.Content, {
156
+ "data-control-ui": "drawer",
157
+ "data-control-family": "popup",
158
+ "data-popup-kind": "drawer",
159
+ "data-slot": "body",
160
+ "data-padding": padding,
161
+ className: cn("flex min-h-0 flex-1 flex-col overflow-y-auto", className),
149
162
  ...props
150
163
  });
151
164
  }
@@ -155,7 +168,7 @@ function DrawerFooter({ className, ...props }) {
155
168
  "data-control-family": "popup",
156
169
  "data-popup-kind": "drawer",
157
170
  "data-slot": "footer",
158
- className: cn("mt-auto flex flex-col", className),
171
+ className: cn("mt-auto flex shrink-0 flex-col sm:flex-row sm:justify-end", className),
159
172
  ...props
160
173
  });
161
174
  }
@@ -180,4 +193,4 @@ function DrawerDescription({ className, ...props }) {
180
193
  });
181
194
  }
182
195
  //#endregion
183
- export { Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerTitle, DrawerTrigger, drawerContentPaddings, drawerContentSurfaces, drawerContentVariants, drawerSides };
196
+ export { Drawer, DrawerBody, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerTitle, DrawerTrigger, drawerBodyPaddings, drawerContentSurfaces, drawerContentVariants, drawerSides };
@@ -30,7 +30,7 @@ function DropdownMenuTrigger({ size = "sm", iconOnly = false, variant = "surface
30
30
  children
31
31
  });
32
32
  }
33
- function DropdownMenuContent({ className, children, side = "bottom", sideOffset = 6, align = "start", alignOffset, collisionBoundary, collisionPadding, collisionAvoidance, ...props }) {
33
+ function DropdownMenuContent({ className, children, side, sideOffset = 6, align = "start", alignOffset, collisionBoundary, collisionPadding, collisionAvoidance, ...props }) {
34
34
  const skin = useSkin();
35
35
  return /* @__PURE__ */ jsx(Menu.Portal, { children: /* @__PURE__ */ jsx(Menu.Positioner, {
36
36
  "data-skin": skin.id,
@@ -76,7 +76,7 @@ function DropdownMenuSeparator({ className, ...props }) {
76
76
  });
77
77
  }
78
78
  function DropdownMenuLabel({ className, ...props }) {
79
- return /* @__PURE__ */ jsx("div", {
79
+ return /* @__PURE__ */ jsx(Menu.GroupLabel, {
80
80
  "data-control-ui": "dropdown-menu",
81
81
  "data-slot": "label",
82
82
  "data-control-family": "popup",
@@ -162,6 +162,7 @@ function DropdownMenuSubTrigger({ className, children, ...props }) {
162
162
  "data-control-ui": "dropdown-menu",
163
163
  "data-control-family": "popup",
164
164
  "data-slot": "sub-trigger-indicator",
165
+ "data-icon-dir": "inline",
165
166
  "aria-hidden": "true",
166
167
  children: "›"
167
168
  })]
@@ -171,7 +172,6 @@ function DropdownMenuSubContent(props) {
171
172
  return /* @__PURE__ */ jsx(DropdownMenuContent, {
172
173
  "data-control-ui": "dropdown-menu",
173
174
  "data-slot": "sub-content",
174
- side: "right",
175
175
  sideOffset: 0,
176
176
  alignOffset: -3,
177
177
  ...props
@@ -183,6 +183,7 @@ function DropdownMenuShortcut(props) {
183
183
  "data-control-family": "popup",
184
184
  "data-popup-part": "shortcut",
185
185
  "data-slot": "shortcut",
186
+ "aria-hidden": "true",
186
187
  ...props
187
188
  });
188
189
  }
@@ -11,6 +11,8 @@ export type DropzoneProps = Omit<ComponentProps<"div">, "defaultValue" | "onChan
11
11
  onValueChange?: (value: readonly File[], details: DropzoneValueChangeDetails) => void;
12
12
  policy?: DropzonePolicy;
13
13
  disabled?: boolean;
14
+ drag?: boolean;
15
+ paste?: boolean;
14
16
  getFilesFromEvent?: DropzoneGetFilesFromEvent;
15
17
  onDrop?: (details: DropzoneDropDetails) => void;
16
18
  onError?: (error: Error) => void;
@@ -52,15 +54,15 @@ export type DropzoneRemoveProps = ComponentProps<typeof Button> & {
52
54
  };
53
55
  export type DropzoneClearProps = ComponentProps<typeof Button>;
54
56
  export declare function useDropzoneContext(): DropzoneContextValue;
55
- export declare function Dropzone({ value, defaultValue, onValueChange, policy, disabled, getFilesFromEvent, onDrop, onError, className, children, ...props }: DropzoneProps): import("react").JSX.Element;
57
+ export declare function Dropzone({ value, defaultValue, onValueChange, policy, disabled, drag, paste, getFilesFromEvent, onDrop, onError, className, children, ...props }: DropzoneProps): import("react").JSX.Element;
56
58
  export declare function DropzoneArea({ className, ...props }: DropzoneAreaProps): import("react").JSX.Element;
57
59
  export declare function DropzoneInput({ className, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, ...props }: DropzoneInputProps): import("react").JSX.Element;
58
- export declare function DropzoneTrigger({ className, children, onClick, disabled, ...props }: DropzoneTriggerProps): import("react").JSX.Element;
60
+ export declare function DropzoneTrigger({ className, children, onClick, disabled, ref, ...props }: DropzoneTriggerProps): import("react").JSX.Element;
59
61
  export declare function DropzoneOverlay({ scope, className, children, ...props }: DropzoneOverlayProps): import("react").JSX.Element;
60
62
  export declare function DropzoneFileList({ className, children, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, ...props }: DropzoneFileListProps): import("react").JSX.Element;
61
63
  export declare function DropzoneRejectionList({ className, children, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, ...props }: DropzoneRejectionListProps): import("react").JSX.Element;
62
64
  export declare function DropzoneStatus({ className, children, role, "aria-live": ariaLive, ...props }: DropzoneStatusProps): import("react").JSX.Element;
63
- export declare function DropzoneRemove({ file, children, onClick, disabled, ...props }: DropzoneRemoveProps): import("react").JSX.Element;
65
+ export declare function DropzoneRemove({ file, children, onClick, disabled, ref, ...props }: DropzoneRemoveProps): import("react").JSX.Element;
64
66
  export declare function DropzoneClear({ children, onClick, disabled, ...props }: DropzoneClearProps): import("react").JSX.Element;
65
67
  //#endregion
66
68
  export { type DropzoneAccept, type DropzoneDropDetails, DropzoneErrorCode, type DropzoneErrorCodeValue, type DropzoneEvent, type DropzoneFileError, type DropzoneFileRejection, type DropzoneGetFilesFromEvent, type DropzonePolicy, type DropzoneSelectionMode, type DropzoneValidator, type DropzoneValidatorResult, type DropzoneValueChangeDetails, type DropzoneValueChangeReason, type DropzoneVisualState, type UseDropzoneOptions, type UseDropzoneReturn, formatDropzoneFileSize, useDropzone };