@ctrl-ui/react 0.8.7 → 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 (351) hide show
  1. package/dist/action-bar.d.ts +15 -7
  2. package/dist/action-bar.js +40 -20
  3. package/dist/activity.js +8 -16
  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 +39 -39
  8. package/dist/blocks/design-canvas-inspector.js +2 -2
  9. package/dist/blocks/design-canvas.d.ts +5 -1
  10. package/dist/blocks/design-canvas.js +200 -94
  11. package/dist/blocks/discussion.d.ts +28 -0
  12. package/dist/blocks/discussion.js +67 -0
  13. package/dist/blocks/file-explorer-data.d.ts +1 -0
  14. package/dist/blocks/file-explorer-data.js +4 -1
  15. package/dist/blocks/file-explorer.d.ts +9 -1
  16. package/dist/blocks/file-explorer.js +461 -192
  17. package/dist/blocks/settings.d.ts +2 -1
  18. package/dist/blocks/settings.js +102 -80
  19. package/dist/blocks/team-chat.d.ts +12 -0
  20. package/dist/blocks/team-chat.js +26 -0
  21. package/dist/blocks/theme-toggle.js +23 -31
  22. package/dist/chat-composer-attachment.d.ts +4 -1
  23. package/dist/chat-composer-attachment.js +35 -10
  24. package/dist/chat-composer-editor/extensions/mention.d.ts +5 -1
  25. package/dist/chat-composer-editor/extensions/mention.js +58 -27
  26. package/dist/chat-composer-editor/ghost.js +2 -4
  27. package/dist/chat-composer-editor/types.d.ts +5 -0
  28. package/dist/chat-composer-editor.d.ts +1 -1
  29. package/dist/chat-composer-editor.js +57 -30
  30. package/dist/chat-composer.d.ts +13 -32
  31. package/dist/chat-composer.js +53 -13
  32. package/dist/chat-layout.d.ts +19 -0
  33. package/dist/chat-layout.js +91 -40
  34. package/dist/chat-message/social.d.ts +26 -0
  35. package/dist/chat-message/social.js +122 -0
  36. package/dist/chat-message.d.ts +28 -29
  37. package/dist/chat-message.js +106 -25
  38. package/dist/context.d.ts +2 -2
  39. package/dist/context.js +39 -24
  40. package/dist/dynamic-notification-canvas-loop.d.ts +24 -0
  41. package/dist/dynamic-notification-canvas-loop.js +113 -0
  42. package/dist/dynamic-notification-glass.js +23 -114
  43. package/dist/dynamic-notification-liquid.js +14 -118
  44. package/dist/dynamic-notification.d.ts +16 -8
  45. package/dist/dynamic-notification.js +86 -23
  46. package/dist/email/email-brand.d.ts +7 -4
  47. package/dist/email/email-brand.js +9 -6
  48. package/dist/email/email-code.d.ts +3 -2
  49. package/dist/email/email-code.js +11 -9
  50. package/dist/email/email-footer.d.ts +5 -3
  51. package/dist/email/email-footer.js +11 -5
  52. package/dist/email/email.d.ts +31 -9
  53. package/dist/email/email.js +50 -26
  54. package/dist/email/templates.d.ts +10 -9
  55. package/dist/email/templates.js +102 -38
  56. package/dist/email/theme.js +1 -1
  57. package/dist/environment-variables.d.ts +4 -2
  58. package/dist/environment-variables.js +52 -32
  59. package/dist/filter-bar/editor.js +20 -8
  60. package/dist/filter-bar/model.d.ts +1 -0
  61. package/dist/filter-bar/model.js +10 -1
  62. package/dist/filter-bar/motion.js +4 -4
  63. package/dist/filter-bar/parts.js +20 -9
  64. package/dist/filter-bar/types.d.ts +1 -0
  65. package/dist/filter-bar.js +20 -14
  66. package/dist/hooks/use-audio-recorder.js +12 -6
  67. package/dist/hooks/use-chat-composer.d.ts +19 -7
  68. package/dist/hooks/use-chat-composer.js +32 -5
  69. package/dist/hooks/use-chat-message.d.ts +28 -2
  70. package/dist/hooks/use-chat-message.js +41 -10
  71. package/dist/hooks/use-chat-thread-scroll.js +43 -7
  72. package/dist/hooks/use-color-area.d.ts +3 -3
  73. package/dist/hooks/use-color-area.js +13 -12
  74. package/dist/hooks/use-copy-to-clipboard.d.ts +2 -1
  75. package/dist/hooks/use-copy-to-clipboard.js +20 -20
  76. package/dist/hooks/use-dynamic-notification.d.ts +6 -2
  77. package/dist/hooks/use-dynamic-notification.js +26 -10
  78. package/dist/hooks/use-mobile.d.ts +3 -2
  79. package/dist/hooks/use-mobile.js +8 -4
  80. package/dist/hooks/use-textarea-trigger-menu.js +2 -1
  81. package/dist/hooks/use-trigger-menu.d.ts +54 -0
  82. package/dist/hooks/use-trigger-menu.js +102 -47
  83. package/dist/hooks/use-user-ask.d.ts +2 -0
  84. package/dist/hooks/use-user-ask.js +35 -41
  85. package/dist/inline-attachment.d.ts +6 -2
  86. package/dist/inline-attachment.js +36 -15
  87. package/dist/inline-citation.d.ts +12 -5
  88. package/dist/inline-citation.js +26 -17
  89. package/dist/knob-contracts/audio-recorder-knobs.d.ts +1 -1
  90. package/dist/knob-contracts/audio-recorder-knobs.js +2 -1
  91. package/dist/knob-contracts/audio-visualizer-knobs.d.ts +1 -1
  92. package/dist/knob-contracts/audio-visualizer-knobs.js +2 -1
  93. package/dist/knob-contracts/avatar-knobs.d.ts +1 -1
  94. package/dist/knob-contracts/avatar-knobs.js +6 -1
  95. package/dist/knob-contracts/badge-knobs.d.ts +1 -1
  96. package/dist/knob-contracts/badge-knobs.js +2 -1
  97. package/dist/knob-contracts/breadcrumb-knobs.d.ts +4 -0
  98. package/dist/knob-contracts/breadcrumb-knobs.js +8 -0
  99. package/dist/knob-contracts/button-knobs.d.ts +1 -1
  100. package/dist/knob-contracts/button-knobs.js +1 -0
  101. package/dist/knob-contracts/chat-message-knobs.d.ts +1 -1
  102. package/dist/knob-contracts/chat-message-knobs.js +8 -1
  103. package/dist/knob-contracts/code-diff-knobs.d.ts +1 -1
  104. package/dist/knob-contracts/code-diff-knobs.js +2 -0
  105. package/dist/knob-contracts/code-knobs.d.ts +1 -1
  106. package/dist/knob-contracts/code-knobs.js +2 -1
  107. package/dist/knob-contracts/dynamic-notification-knobs.d.ts +1 -1
  108. package/dist/knob-contracts/dynamic-notification-knobs.js +2 -0
  109. package/dist/knob-contracts/emoji-picker-knobs.d.ts +4 -0
  110. package/dist/knob-contracts/emoji-picker-knobs.js +10 -0
  111. package/dist/knob-contracts/field-knobs.d.ts +1 -1
  112. package/dist/knob-contracts/field-knobs.js +5 -1
  113. package/dist/knob-contracts/filter-bar-knobs.d.ts +1 -1
  114. package/dist/knob-contracts/filter-bar-knobs.js +1 -2
  115. package/dist/knob-contracts/markdown-knobs.d.ts +1 -1
  116. package/dist/knob-contracts/markdown-knobs.js +3 -1
  117. package/dist/knob-contracts/page-layout-knobs.d.ts +1 -1
  118. package/dist/knob-contracts/page-layout-knobs.js +2 -1
  119. package/dist/knob-contracts/popup-knobs.d.ts +1 -1
  120. package/dist/knob-contracts/popup-knobs.js +27 -0
  121. package/dist/knob-contracts/range-knobs.d.ts +1 -1
  122. package/dist/knob-contracts/range-knobs.js +1 -0
  123. package/dist/knob-contracts/rich-tooltip-knobs.d.ts +1 -1
  124. package/dist/knob-contracts/rich-tooltip-knobs.js +2 -1
  125. package/dist/knob-contracts/sidebar-knobs.d.ts +1 -1
  126. package/dist/knob-contracts/sidebar-knobs.js +27 -2
  127. package/dist/knob-contracts/spinner-knobs.d.ts +1 -1
  128. package/dist/knob-contracts/spinner-knobs.js +1 -1
  129. package/dist/knob-contracts/stepper-knobs.d.ts +1 -1
  130. package/dist/knob-contracts/stepper-knobs.js +4 -1
  131. package/dist/knob-contracts/switch-knobs.d.ts +1 -1
  132. package/dist/knob-contracts/switch-knobs.js +5 -0
  133. package/dist/knob-contracts/table-of-contents-knobs.d.ts +1 -1
  134. package/dist/knob-contracts/table-of-contents-knobs.js +2 -1
  135. package/dist/knob-contracts/tabs-knobs.d.ts +1 -1
  136. package/dist/knob-contracts/tabs-knobs.js +1 -0
  137. package/dist/knob-contracts/tree-knobs.d.ts +1 -1
  138. package/dist/knob-contracts/tree-knobs.js +2 -1
  139. package/dist/lib/cn.js +0 -4
  140. package/dist/lib/contrast.d.ts +1 -0
  141. package/dist/lib/contrast.js +17 -5
  142. package/dist/lib/dropzone-validation.js +41 -28
  143. package/dist/lib/env-file.d.ts +1 -1
  144. package/dist/lib/env-file.js +5 -5
  145. package/dist/lib/motion.d.ts +4 -0
  146. package/dist/lib/motion.js +15 -0
  147. package/dist/lib/phone-input-format.js +1 -1
  148. package/dist/lib/trigger-detect.js +6 -8
  149. package/dist/markdown-block.js +2 -1
  150. package/dist/popup-parts.d.ts +8 -0
  151. package/dist/popup-parts.js +43 -0
  152. package/dist/source-badge.js +3 -1
  153. package/dist/styles/code.css +0 -2
  154. package/dist/styles/effects.css +6 -32
  155. package/dist/styles/index.css +10 -5
  156. package/dist/styles/recipes/accordion.css +9 -6
  157. package/dist/styles/recipes/action-bar.css +0 -15
  158. package/dist/styles/recipes/activity.css +5 -11
  159. package/dist/styles/recipes/alert.css +4 -4
  160. package/dist/styles/recipes/audio-recorder.css +15 -3
  161. package/dist/styles/recipes/audio-visualizer.css +13 -2
  162. package/dist/styles/recipes/avatar.css +78 -1
  163. package/dist/styles/recipes/badge.css +14 -4
  164. package/dist/styles/recipes/breadcrumb.css +77 -0
  165. package/dist/styles/recipes/button-group.css +5 -7
  166. package/dist/styles/recipes/button-states.css +66 -0
  167. package/dist/styles/recipes/button.css +24 -83
  168. package/dist/styles/recipes/calendar.css +17 -23
  169. package/dist/styles/recipes/card.css +2 -2
  170. package/dist/styles/recipes/chat-composer-attachment.css +9 -3
  171. package/dist/styles/recipes/chat-composer.css +7 -10
  172. package/dist/styles/recipes/chat-layout.css +35 -0
  173. package/dist/styles/recipes/chat-message-social.css +123 -0
  174. package/dist/styles/recipes/chat-message.css +157 -37
  175. package/dist/styles/recipes/choice.css +18 -21
  176. package/dist/styles/recipes/code-diff.css +46 -33
  177. package/dist/styles/recipes/code.css +36 -16
  178. package/dist/styles/recipes/collapsible.css +7 -2
  179. package/dist/styles/recipes/color-picker-details.css +3 -4
  180. package/dist/styles/recipes/color-picker-values.css +9 -8
  181. package/dist/styles/recipes/color-picker.css +11 -2
  182. package/dist/styles/recipes/context.css +3 -3
  183. package/dist/styles/recipes/dockable-panel.css +7 -4
  184. package/dist/styles/recipes/dropzone.css +7 -8
  185. package/dist/styles/recipes/dynamic-notification-input.css +8 -5
  186. package/dist/styles/recipes/dynamic-notification-motion.css +12 -21
  187. package/dist/styles/recipes/dynamic-notification.css +40 -26
  188. package/dist/styles/recipes/emoji-picker.css +132 -0
  189. package/dist/styles/recipes/empty.css +5 -4
  190. package/dist/styles/recipes/environment-variables.css +4 -15
  191. package/dist/styles/recipes/field-parts.css +30 -24
  192. package/dist/styles/recipes/field.css +61 -26
  193. package/dist/styles/recipes/filter-bar.css +18 -31
  194. package/dist/styles/recipes/gradient-editor.css +18 -7
  195. package/dist/styles/recipes/infinite-canvas.css +0 -1
  196. package/dist/styles/recipes/inline-attachment.css +3 -3
  197. package/dist/styles/recipes/inline-citation.css +10 -4
  198. package/dist/styles/recipes/item.css +23 -9
  199. package/dist/styles/recipes/markdown-block.css +5 -4
  200. package/dist/styles/recipes/markdown.css +68 -26
  201. package/dist/styles/recipes/morphing-panel.css +8 -8
  202. package/dist/styles/recipes/page-layout.css +20 -12
  203. package/dist/styles/recipes/pagination.css +4 -5
  204. package/dist/styles/recipes/phone-input.css +12 -8
  205. package/dist/styles/recipes/popup-controls.css +166 -33
  206. package/dist/styles/recipes/popup-drawer.css +3 -14
  207. package/dist/styles/recipes/popup-lists.css +128 -27
  208. package/dist/styles/recipes/popup-motion.css +4 -45
  209. package/dist/styles/recipes/popup-toast.css +55 -26
  210. package/dist/styles/recipes/popup.css +139 -141
  211. package/dist/styles/recipes/range.css +54 -18
  212. package/dist/styles/recipes/resizable.css +2 -7
  213. package/dist/styles/recipes/rich-tooltip.css +24 -34
  214. package/dist/styles/recipes/scroll-area.css +8 -1
  215. package/dist/styles/recipes/sidebar-menu.css +149 -34
  216. package/dist/styles/recipes/sidebar-parts.css +154 -0
  217. package/dist/styles/recipes/sidebar.css +187 -128
  218. package/dist/styles/recipes/source-badge.css +1 -1
  219. package/dist/styles/recipes/spinner.css +8 -1
  220. package/dist/styles/recipes/stepper.css +31 -13
  221. package/dist/styles/recipes/switch.css +68 -23
  222. package/dist/styles/recipes/table-of-contents.css +9 -1
  223. package/dist/styles/recipes/table.css +14 -10
  224. package/dist/styles/recipes/tabs.css +17 -12
  225. package/dist/styles/recipes/task-list.css +7 -14
  226. package/dist/styles/recipes/thread-rail.css +42 -19
  227. package/dist/styles/recipes/timeline.css +2 -0
  228. package/dist/styles/recipes/toolbar.css +27 -25
  229. package/dist/styles/recipes/track-highlight.css +10 -7
  230. package/dist/styles/recipes/tree.css +31 -4
  231. package/dist/styles/recipes/user-ask-details.css +0 -1
  232. package/dist/styles/recipes/user-ask.css +4 -4
  233. package/dist/styles/theme.css +37 -16
  234. package/dist/task-list.d.ts +4 -1
  235. package/dist/task-list.js +24 -8
  236. package/dist/thread-rail.d.ts +1 -1
  237. package/dist/thread-rail.js +61 -19
  238. package/dist/transcript-divider.js +2 -1
  239. package/dist/ui/alert-dialog.js +1 -1
  240. package/dist/ui/alert.d.ts +3 -1
  241. package/dist/ui/alert.js +14 -8
  242. package/dist/ui/autocomplete.js +4 -2
  243. package/dist/ui/avatar.d.ts +8 -0
  244. package/dist/ui/avatar.js +23 -3
  245. package/dist/ui/badge.js +1 -1
  246. package/dist/ui/breadcrumb.d.ts +27 -0
  247. package/dist/ui/breadcrumb.js +88 -0
  248. package/dist/ui/button.d.ts +2 -1
  249. package/dist/ui/button.js +3 -3
  250. package/dist/ui/calendar.js +2 -2
  251. package/dist/ui/card.d.ts +3 -1
  252. package/dist/ui/card.js +12 -7
  253. package/dist/ui/checkbox.d.ts +2 -0
  254. package/dist/ui/code-diff.d.ts +1 -1
  255. package/dist/ui/code-diff.js +72 -28
  256. package/dist/ui/code.d.ts +5 -3
  257. package/dist/ui/code.js +28 -29
  258. package/dist/ui/collapsible.js +1 -1
  259. package/dist/ui/color-picker.d.ts +5 -2
  260. package/dist/ui/color-picker.js +85 -37
  261. package/dist/ui/combobox-disabled-selection.d.ts +1 -2
  262. package/dist/ui/combobox-disabled-selection.js +7 -9
  263. package/dist/ui/combobox.js +14 -6
  264. package/dist/ui/command.d.ts +8 -2
  265. package/dist/ui/command.js +30 -14
  266. package/dist/ui/context-menu.js +4 -1
  267. package/dist/ui/dialog.d.ts +2 -1
  268. package/dist/ui/dialog.js +4 -23
  269. package/dist/ui/dockable-panel-geometry.d.ts +1 -0
  270. package/dist/ui/dockable-panel-geometry.js +7 -1
  271. package/dist/ui/dockable-panel.d.ts +9 -6
  272. package/dist/ui/dockable-panel.js +63 -23
  273. package/dist/ui/drawer.js +1 -1
  274. package/dist/ui/dropdown-menu.js +5 -4
  275. package/dist/ui/dropzone.d.ts +2 -2
  276. package/dist/ui/dropzone.js +75 -16
  277. package/dist/ui/emoji-picker.d.ts +18 -0
  278. package/dist/ui/emoji-picker.js +136 -0
  279. package/dist/ui/empty.d.ts +3 -1
  280. package/dist/ui/empty.js +12 -7
  281. package/dist/ui/gradient-editor.d.ts +1 -1
  282. package/dist/ui/gradient-editor.js +37 -21
  283. package/dist/ui/hover-card.js +1 -1
  284. package/dist/ui/infinite-canvas.d.ts +3 -2
  285. package/dist/ui/infinite-canvas.js +63 -19
  286. package/dist/ui/input-group.d.ts +0 -3
  287. package/dist/ui/input-group.js +4 -14
  288. package/dist/ui/input-otp.d.ts +1 -1
  289. package/dist/ui/input-otp.js +32 -15
  290. package/dist/ui/input.js +4 -4
  291. package/dist/ui/item.d.ts +2 -1
  292. package/dist/ui/item.js +12 -8
  293. package/dist/ui/live-status.d.ts +7 -0
  294. package/dist/ui/live-status.js +17 -0
  295. package/dist/ui/markdown-elements.d.ts +6 -0
  296. package/dist/ui/markdown-elements.js +31 -1
  297. package/dist/ui/menubar.js +3 -3
  298. package/dist/ui/morphing-panel.js +3 -2
  299. package/dist/ui/native-select.d.ts +1 -1
  300. package/dist/ui/native-select.js +24 -11
  301. package/dist/ui/navigation-menu.js +1 -1
  302. package/dist/ui/page-layout.d.ts +2 -2
  303. package/dist/ui/page-layout.js +2 -4
  304. package/dist/ui/pagination.d.ts +7 -5
  305. package/dist/ui/pagination.js +19 -13
  306. package/dist/ui/phone-input.d.ts +1 -0
  307. package/dist/ui/phone-input.js +58 -60
  308. package/dist/ui/popover.js +1 -1
  309. package/dist/ui/radio-group.d.ts +2 -0
  310. package/dist/ui/resizable.d.ts +3 -2
  311. package/dist/ui/resizable.js +5 -3
  312. package/dist/ui/responsive-dialog.d.ts +1 -1
  313. package/dist/ui/responsive-dialog.js +4 -21
  314. package/dist/ui/rich-tooltip.d.ts +10 -4
  315. package/dist/ui/rich-tooltip.js +82 -34
  316. package/dist/ui/scroll-area.d.ts +1 -1
  317. package/dist/ui/scroll-area.js +43 -28
  318. package/dist/ui/select.js +1 -1
  319. package/dist/ui/sheet.js +1 -1
  320. package/dist/ui/sidebar-menu.d.ts +5 -1
  321. package/dist/ui/sidebar-menu.js +32 -34
  322. package/dist/ui/sidebar-provider.d.ts +10 -1
  323. package/dist/ui/sidebar-provider.js +39 -14
  324. package/dist/ui/sidebar-resize-rail.js +8 -4
  325. package/dist/ui/sidebar.d.ts +11 -6
  326. package/dist/ui/sidebar.js +47 -24
  327. package/dist/ui/slider.js +31 -22
  328. package/dist/ui/spinner.d.ts +3 -2
  329. package/dist/ui/spinner.js +3 -2
  330. package/dist/ui/stepper.d.ts +8 -1
  331. package/dist/ui/stepper.js +74 -25
  332. package/dist/ui/switch.d.ts +1 -0
  333. package/dist/ui/table-of-contents.d.ts +2 -2
  334. package/dist/ui/table-of-contents.js +20 -8
  335. package/dist/ui/table.js +4 -2
  336. package/dist/ui/textarea.d.ts +1 -1
  337. package/dist/ui/textarea.js +20 -9
  338. package/dist/ui/timeline.d.ts +3 -1
  339. package/dist/ui/timeline.js +17 -9
  340. package/dist/ui/toast.d.ts +11 -5
  341. package/dist/ui/toast.js +101 -55
  342. package/dist/ui/toolbar.d.ts +3 -2
  343. package/dist/ui/toolbar.js +4 -2
  344. package/dist/ui/tooltip.js +4 -21
  345. package/dist/ui/tree.js +121 -81
  346. package/dist/ui/trigger-menu.js +2 -1
  347. package/dist/user-ask.d.ts +10 -5
  348. package/dist/user-ask.js +32 -12
  349. package/package.json +5 -1
  350. package/dist/hooks/use-keyboard-navigation.d.ts +0 -3
  351. package/dist/hooks/use-keyboard-navigation.js +0 -22
@@ -0,0 +1,88 @@
1
+ "use client";
2
+ import { cn } from "../lib/cn.js";
3
+ import { useRender } from "@base-ui/react/use-render";
4
+ import { jsx, jsxs } from "react/jsx-runtime";
5
+ import { ChevronRight, MoreHorizontal } from "lucide-react";
6
+ //#region src/ui/breadcrumb.tsx
7
+ function Breadcrumb({ className, ...props }) {
8
+ return /* @__PURE__ */ jsx("nav", {
9
+ "aria-label": "Breadcrumb",
10
+ "data-control-ui": "breadcrumb",
11
+ "data-control-family": "breadcrumb",
12
+ "data-slot": "root",
13
+ className,
14
+ ...props
15
+ });
16
+ }
17
+ function BreadcrumbList({ className, ...props }) {
18
+ return /* @__PURE__ */ jsx("ol", {
19
+ "data-control-ui": "breadcrumb",
20
+ "data-control-family": "breadcrumb",
21
+ "data-slot": "list",
22
+ className: cn("flex flex-wrap items-center break-words", className),
23
+ ...props
24
+ });
25
+ }
26
+ function BreadcrumbItem({ className, ...props }) {
27
+ return /* @__PURE__ */ jsx("li", {
28
+ "data-control-ui": "breadcrumb",
29
+ "data-control-family": "breadcrumb",
30
+ "data-slot": "item",
31
+ className: cn("inline-flex items-center", className),
32
+ ...props
33
+ });
34
+ }
35
+ function BreadcrumbLink({ render, className, children, ...props }) {
36
+ return useRender({
37
+ defaultTagName: "a",
38
+ render,
39
+ props: {
40
+ ...props,
41
+ "data-control-ui": "breadcrumb",
42
+ "data-control-family": "breadcrumb",
43
+ "data-slot": "link",
44
+ className,
45
+ children
46
+ }
47
+ });
48
+ }
49
+ function BreadcrumbPage({ className, ...props }) {
50
+ return /* @__PURE__ */ jsx("span", {
51
+ "data-control-ui": "breadcrumb",
52
+ "data-control-family": "breadcrumb",
53
+ "data-slot": "page",
54
+ "aria-current": "page",
55
+ className,
56
+ ...props
57
+ });
58
+ }
59
+ function BreadcrumbSeparator({ children, className, ...props }) {
60
+ return /* @__PURE__ */ jsx("li", {
61
+ "data-control-ui": "breadcrumb",
62
+ "data-control-family": "breadcrumb",
63
+ "data-slot": "separator",
64
+ role: "presentation",
65
+ "aria-hidden": "true",
66
+ className: cn("[&>svg]:size-3.5", className),
67
+ ...props,
68
+ children: children ?? /* @__PURE__ */ jsx(ChevronRight, { "data-icon-dir": "inline" })
69
+ });
70
+ }
71
+ function BreadcrumbEllipsis({ label = "Show hidden breadcrumbs", className, ...props }) {
72
+ return /* @__PURE__ */ jsxs("span", {
73
+ "data-control-ui": "breadcrumb",
74
+ "data-control-family": "breadcrumb",
75
+ "data-slot": "ellipsis",
76
+ className: cn("flex items-center justify-center", className),
77
+ ...props,
78
+ children: [/* @__PURE__ */ jsx(MoreHorizontal, {
79
+ "aria-hidden": "true",
80
+ className: "size-4"
81
+ }), /* @__PURE__ */ jsx("span", {
82
+ className: "sr-only",
83
+ children: label
84
+ })]
85
+ });
86
+ }
87
+ //#endregion
88
+ export { Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator };
@@ -23,12 +23,13 @@ export type ButtonProps = ComponentProps<"button"> & ButtonAppearanceProps & {
23
23
  disabled: boolean;
24
24
  }>;
25
25
  nativeButton?: boolean;
26
+ focusableWhenDisabled?: boolean;
26
27
  };
27
28
  export type ButtonLinkProps = ComponentProps<"a"> & ButtonAppearanceProps & {
28
29
  render?: RenderProp<ComponentProps<"a">>;
29
30
  };
30
31
  export type ButtonLabelProps = ComponentProps<"label"> & ButtonAppearanceProps;
31
- export declare const buttonStructureClasses = "relative isolate inline-flex shrink-0 items-center justify-center overflow-visible whitespace-nowrap";
32
+ export declare const buttonStructureClasses = "isolate inline-flex shrink-0 items-center justify-center overflow-visible whitespace-nowrap";
32
33
  export declare const buttonTrackStructureClasses = "data-[track=hover]:relative data-[track=hover]:isolate [&_[data-track-item]]:[isolation:auto]";
33
34
  export declare const buttonContentClasses = "relative z-[1] inline-flex min-w-0 items-center justify-center gap-[inherit]";
34
35
  export declare function Button({ variant, size, tone, active, iconOnly, shape, type, disabled, render, nativeButton, className, children, ...props }: ButtonProps): import("react").JSX.Element;
package/dist/ui/button.js CHANGED
@@ -1,15 +1,15 @@
1
1
  "use client";
2
- import { skinAdornment } from "../skin.js";
3
2
  import { cn } from "../lib/cn.js";
3
+ import { skinAdornment } from "../skin.js";
4
4
  import { useSkin } from "../skin-provider.js";
5
5
  import { Children, Fragment, createContext, isValidElement, useContext } from "react";
6
- import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
7
6
  import { Button as Button$1 } from "@base-ui/react/button";
8
7
  import { useRender } from "@base-ui/react/use-render";
8
+ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
9
9
  //#region src/ui/button.tsx
10
10
  const ButtonTrackContext = createContext(false);
11
11
  const buttonShapes = ["default", "circle"];
12
- const buttonStructureClasses = "relative isolate inline-flex shrink-0 items-center justify-center overflow-visible whitespace-nowrap";
12
+ const buttonStructureClasses = "isolate inline-flex shrink-0 items-center justify-center overflow-visible whitespace-nowrap";
13
13
  const buttonTrackStructureClasses = "data-[track=hover]:relative data-[track=hover]:isolate [&_[data-track-item]]:[isolation:auto]";
14
14
  const buttonContentClasses = "relative z-[1] inline-flex min-w-0 items-center justify-center gap-[inherit]";
15
15
  function wrapButtonText(children) {
@@ -4,8 +4,8 @@ import { useEffect, useRef } from "react";
4
4
  import { jsx } from "react/jsx-runtime";
5
5
  import { CaptionLabel, Day, DayPicker, Month, MonthCaption, MonthGrid, Months, Nav, Weekday } from "react-day-picker";
6
6
  //#region src/ui/calendar.tsx
7
- const dayButtonClasses = "flex w-full items-center justify-center disabled:pointer-events-none";
8
- const navButtonClasses = "inline-flex items-center justify-center disabled:pointer-events-none";
7
+ const dayButtonClasses = "flex w-full items-center justify-center disabled:pointer-events-none aria-disabled:pointer-events-none";
8
+ const navButtonClasses = "inline-flex items-center justify-center disabled:pointer-events-none aria-disabled:pointer-events-none";
9
9
  const chevronPathByOrientation = {
10
10
  left: "M10 3 5.5 8 10 13",
11
11
  right: "M6 3 10.5 8 6 13",
package/dist/ui/card.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { RenderProp } from "../control-props.js";
1
2
  import { CardKnobStyle } from "../knob-contracts/card-knobs.js";
2
3
  import { CSSProperties, ComponentProps } from "react";
3
4
  //#region src/ui/card.d.ts
@@ -11,6 +12,7 @@ export type CardHeaderProps = ComponentProps<"div"> & {
11
12
  style?: CSSProperties & CardKnobStyle;
12
13
  };
13
14
  export type CardTitleProps = Omit<ComponentProps<"div">, "style"> & {
15
+ render?: RenderProp<ComponentProps<"div">>;
14
16
  style?: CSSProperties & CardKnobStyle;
15
17
  };
16
18
  export type CardDescriptionProps = ComponentProps<"div"> & {
@@ -27,7 +29,7 @@ export type CardFooterProps = ComponentProps<"div"> & {
27
29
  };
28
30
  export declare function Card({ variant, className, ...props }: CardProps): import("react").JSX.Element;
29
31
  export declare function CardHeader({ className, ...props }: CardHeaderProps): import("react").JSX.Element;
30
- export declare function CardTitle({ className, ...props }: CardTitleProps): import("react").JSX.Element;
32
+ export declare function CardTitle({ render, ...props }: CardTitleProps): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
31
33
  export declare function CardDescription({ className, ...props }: CardDescriptionProps): import("react").JSX.Element;
32
34
  export declare function CardAction({ className, ...props }: CardActionProps): import("react").JSX.Element;
33
35
  export declare function CardContent({ className, ...props }: CardContentProps): import("react").JSX.Element;
package/dist/ui/card.js CHANGED
@@ -1,4 +1,6 @@
1
+ "use client";
1
2
  import { cn } from "../lib/cn.js";
3
+ import { useRender } from "@base-ui/react/use-render";
2
4
  import { jsx } from "react/jsx-runtime";
3
5
  //#region src/ui/card.tsx
4
6
  function Card({ variant = "default", className, ...props }) {
@@ -21,13 +23,16 @@ function CardHeader({ className, ...props }) {
21
23
  ...props
22
24
  });
23
25
  }
24
- function CardTitle({ className, ...props }) {
25
- return /* @__PURE__ */ jsx("div", {
26
- "data-control-ui": "card",
27
- "data-control-family": "card",
28
- "data-slot": "title",
29
- className,
30
- ...props
26
+ function CardTitle({ render, ...props }) {
27
+ return useRender({
28
+ defaultTagName: "div",
29
+ render,
30
+ props: {
31
+ ...props,
32
+ "data-control-ui": "card",
33
+ "data-control-family": "card",
34
+ "data-slot": "title"
35
+ }
31
36
  });
32
37
  }
33
38
  function CardDescription({ className, ...props }) {
@@ -15,6 +15,8 @@ export type CheckboxProps = Omit<{
15
15
  className?: string;
16
16
  "aria-label"?: string;
17
17
  "aria-labelledby"?: string;
18
+ "aria-describedby"?: string;
19
+ "aria-invalid"?: boolean | "true" | "false";
18
20
  }, "style"> & {
19
21
  style?: CSSProperties & ChoiceKnobStyle;
20
22
  };
@@ -3,7 +3,7 @@ import { CodeCopyProps, CodeOverflow } from "./code.js";
3
3
  import { CSSProperties, ComponentProps, ReactNode } from "react";
4
4
  //#region src/ui/code-diff.d.ts
5
5
  export type DiffStyle = "unified" | "split";
6
- export type DiffIndicators = "classic" | "bars" | "none";
6
+ export type DiffIndicators = "classic" | "bars";
7
7
  export type DiffLineKind = "word" | "char" | "none";
8
8
  export type CodeDiffProps = Omit<ComponentProps<"figure">, "children" | "style"> & {
9
9
  patch?: string;
@@ -1,12 +1,13 @@
1
1
  "use client";
2
2
  import { cn } from "../lib/cn.js";
3
- import { highlightToTokens, mergeCodeTokenLineWithEmphasis } from "../lib/code-tokens.js";
4
3
  import { ScrollArea } from "./scroll-area.js";
4
+ import { highlightToTokens, mergeCodeTokenLineWithEmphasis } from "../lib/code-tokens.js";
5
5
  import { CodeCopy, CodeFloatingCopy, CodeTokenLine } from "./code.js";
6
6
  import { buildDiffFromFiles, buildDiffFromPatch, diffRunEnd } from "../lib/diff.js";
7
7
  import { useEffect, useMemo, useRef, useState } from "react";
8
8
  import { jsx, jsxs } from "react/jsx-runtime";
9
9
  import { useVirtualizer } from "@tanstack/react-virtual";
10
+ import { flushSync } from "react-dom";
10
11
  //#region src/ui/code-diff.tsx
11
12
  const ESTIMATED_ROW_HEIGHT = 20;
12
13
  const VIRTUALIZE_THRESHOLD = 150;
@@ -116,9 +117,12 @@ function expandedContext(file, gapIndex) {
116
117
  }
117
118
  return lines;
118
119
  }
120
+ function expandedRowId(gapIndex, line) {
121
+ return `exp-${gapIndex}-${line.oldNo ?? line.newNo ?? 0}`;
122
+ }
119
123
  function gapRows(file, hunk, gapIndex, diffStyle, expanded) {
120
124
  if (!(gapIndex > 0 || hunk.collapsedBefore > 0)) return [];
121
- if (expanded.has(gapIndex) && !file.isPartial) return expandedContext(file, gapIndex).map((line) => rowForLine(diffStyle, line, `exp-${gapIndex}-${line.oldNo ?? line.newNo ?? 0}`));
125
+ if (expanded.has(gapIndex) && !file.isPartial) return expandedContext(file, gapIndex).map((line) => rowForLine(diffStyle, line, expandedRowId(gapIndex, line)));
122
126
  const label = hunk.header ?? `@@ -${hunk.oldStart},${hunk.oldCount} +${hunk.newStart},${hunk.newCount} @@`;
123
127
  return [{
124
128
  kind: "separator",
@@ -217,8 +221,7 @@ function Gutter({ children, type }) {
217
221
  children
218
222
  });
219
223
  }
220
- function Marker({ type, indicators }) {
221
- if (indicators !== "classic") return null;
224
+ function Marker({ type }) {
222
225
  return /* @__PURE__ */ jsx("span", {
223
226
  "data-control-ui": "code-diff",
224
227
  "data-control-family": "code-diff",
@@ -247,10 +250,7 @@ function UnifiedRow({ line, tokens, indicators, overflow }) {
247
250
  type: line.type,
248
251
  children: line.newNo ?? ""
249
252
  }),
250
- /* @__PURE__ */ jsx(Marker, {
251
- type: line.type,
252
- indicators
253
- }),
253
+ /* @__PURE__ */ jsx(Marker, { type: line.type }),
254
254
  /* @__PURE__ */ jsx(DiffCode, {
255
255
  line,
256
256
  tokens,
@@ -282,10 +282,7 @@ function SplitHalf({ line, tokens, indicators, overflow, side }) {
282
282
  type: line.type,
283
283
  children: side === "left" ? line.oldNo ?? "" : line.newNo ?? ""
284
284
  }),
285
- /* @__PURE__ */ jsx(Marker, {
286
- type: line.type,
287
- indicators
288
- }),
285
+ /* @__PURE__ */ jsx(Marker, { type: line.type }),
289
286
  /* @__PURE__ */ jsx(DiffCode, {
290
287
  line,
291
288
  tokens,
@@ -303,17 +300,34 @@ function DiffStats({ additions, deletions }) {
303
300
  "data-control-family": "code-diff",
304
301
  "data-slot": "stat",
305
302
  className: "flex items-center",
306
- children: [/* @__PURE__ */ jsxs("span", {
307
- "data-control-ui": "code-diff",
308
- "data-control-family": "code-diff",
309
- "data-slot": "stat-additions",
310
- children: ["+", additions]
311
- }), /* @__PURE__ */ jsxs("span", {
312
- "data-control-ui": "code-diff",
313
- "data-control-family": "code-diff",
314
- "data-slot": "stat-deletions",
315
- children: ["−", deletions]
316
- })]
303
+ children: [
304
+ /* @__PURE__ */ jsxs("span", {
305
+ "data-control-ui": "code-diff",
306
+ "data-control-family": "code-diff",
307
+ "data-slot": "stat-additions",
308
+ "aria-hidden": "true",
309
+ children: ["+", additions]
310
+ }),
311
+ /* @__PURE__ */ jsxs("span", {
312
+ "data-control-ui": "code-diff",
313
+ "data-control-family": "code-diff",
314
+ "data-slot": "stat-deletions",
315
+ "aria-hidden": "true",
316
+ children: ["−", deletions]
317
+ }),
318
+ /* @__PURE__ */ jsxs("span", {
319
+ className: "sr-only",
320
+ children: [
321
+ additions,
322
+ " ",
323
+ additions === 1 ? "addition" : "additions",
324
+ ", ",
325
+ deletions,
326
+ " ",
327
+ deletions === 1 ? "deletion" : "deletions"
328
+ ]
329
+ })
330
+ ]
317
331
  });
318
332
  }
319
333
  function lineDescription(label, line, number) {
@@ -345,6 +359,7 @@ function fileIdentity(file) {
345
359
  }
346
360
  function CodeDiffFileSection({ file, lang, diffStyle, diffIndicators, overflow, maxHeight, showFileHeader }) {
347
361
  const [expanded, setExpanded] = useState(() => /* @__PURE__ */ new Set());
362
+ const [revealedRowId, setRevealedRowId] = useState(null);
348
363
  const texts = useMemo(() => sideTexts(file), [file]);
349
364
  const tokens = useSideTokens(texts.old, texts.new, lang, Boolean(lang));
350
365
  const rows = useMemo(() => buildRows(file, diffStyle, expanded), [
@@ -353,6 +368,7 @@ function CodeDiffFileSection({ file, lang, diffStyle, diffIndicators, overflow,
353
368
  expanded
354
369
  ]);
355
370
  const scrollRef = useRef(null);
371
+ const revealedRowRef = useRef(null);
356
372
  const shouldVirtualize = rows.length > VIRTUALIZE_THRESHOLD;
357
373
  const virtualizer = useVirtualizer({
358
374
  count: rows.length,
@@ -362,7 +378,25 @@ function CodeDiffFileSection({ file, lang, diffStyle, diffIndicators, overflow,
362
378
  enabled: shouldVirtualize
363
379
  });
364
380
  function expandGap(gapIndex) {
365
- setExpanded((current) => new Set(current).add(gapIndex));
381
+ const firstLine = expandedContext(file, gapIndex)[0];
382
+ flushSync(() => {
383
+ setExpanded((current) => new Set(current).add(gapIndex));
384
+ setRevealedRowId(firstLine ? expandedRowId(gapIndex, firstLine) : null);
385
+ });
386
+ revealedRowRef.current?.focus();
387
+ }
388
+ function rowFrameProps(id) {
389
+ if (id !== revealedRowId) return {};
390
+ return {
391
+ tabIndex: -1,
392
+ "data-control-ui": "code-diff",
393
+ "data-control-family": "code-diff",
394
+ "data-slot": "revealed-row"
395
+ };
396
+ }
397
+ function measureRevealedRow(node) {
398
+ revealedRowRef.current = node;
399
+ virtualizer.measureElement(node);
366
400
  }
367
401
  const gridClassName = overflow === "scroll" ? "w-max min-w-full" : "w-full";
368
402
  function renderRow(row) {
@@ -388,6 +422,7 @@ function CodeDiffFileSection({ file, lang, diffStyle, diffIndicators, overflow,
388
422
  "data-control-ui": "code-diff",
389
423
  "data-control-family": "code-diff",
390
424
  "data-slot": "expander-label",
425
+ title: row.label,
391
426
  className: "truncate",
392
427
  children: row.label
393
428
  })]
@@ -433,6 +468,7 @@ function CodeDiffFileSection({ file, lang, diffStyle, diffIndicators, overflow,
433
468
  "data-control-ui": "code-diff",
434
469
  "data-control-family": "code-diff",
435
470
  "data-slot": "file-title",
471
+ title: fileTitle(file),
436
472
  className: "min-w-0 truncate",
437
473
  children: fileTitle(file)
438
474
  }), /* @__PURE__ */ jsx(DiffStats, {
@@ -449,7 +485,7 @@ function CodeDiffFileSection({ file, lang, diffStyle, diffIndicators, overflow,
449
485
  }),
450
486
  /* @__PURE__ */ jsx(ScrollArea, {
451
487
  maxHeight,
452
- viewportClassName: void 0,
488
+ "aria-label": fileTitle(file),
453
489
  viewportProps: {
454
490
  "data-control-ui": "code-diff",
455
491
  "data-control-family": "code-diff",
@@ -466,8 +502,9 @@ function CodeDiffFileSection({ file, lang, diffStyle, diffIndicators, overflow,
466
502
  const row = rows[item.index];
467
503
  if (!row) return null;
468
504
  return /* @__PURE__ */ jsx("div", {
469
- ref: virtualizer.measureElement,
505
+ ref: row.id === revealedRowId ? measureRevealedRow : virtualizer.measureElement,
470
506
  "data-index": item.index,
507
+ ...rowFrameProps(row.id),
471
508
  style: {
472
509
  position: "absolute",
473
510
  top: 0,
@@ -480,7 +517,11 @@ function CodeDiffFileSection({ file, lang, diffStyle, diffIndicators, overflow,
480
517
  })
481
518
  }) : /* @__PURE__ */ jsx("div", {
482
519
  className: gridClassName,
483
- children: rows.map((row) => /* @__PURE__ */ jsx("div", { children: renderRow(row) }, row.id))
520
+ children: rows.map((row) => /* @__PURE__ */ jsx("div", {
521
+ ref: row.id === revealedRowId ? revealedRowRef : void 0,
522
+ ...rowFrameProps(row.id),
523
+ children: renderRow(row)
524
+ }, row.id))
484
525
  })
485
526
  })
486
527
  ]
@@ -499,11 +540,13 @@ function CodeDiff({ patch, oldText, newText, lang, name, diffStyle = "unified",
499
540
  const deletions = files.reduce((total, file) => total + file.deletions, 0);
500
541
  const copyValue = patch ?? newText ?? "";
501
542
  const firstFile = files[0];
543
+ const title = files.length === 1 && firstFile ? fileTitle(firstFile) : `${files.length} files`;
502
544
  return /* @__PURE__ */ jsxs("figure", {
503
545
  "data-control-ui": "code-diff",
504
546
  "data-control-family": "code-diff",
505
547
  "data-slot": "root",
506
548
  "data-surface": "panel",
549
+ dir: "ltr",
507
550
  "data-diff-style": diffStyle,
508
551
  "data-file-count": files.length,
509
552
  "data-header": header ? "true" : void 0,
@@ -519,8 +562,9 @@ function CodeDiff({ patch, oldText, newText, lang, name, diffStyle = "unified",
519
562
  "data-control-ui": "code-diff",
520
563
  "data-control-family": "code-diff",
521
564
  "data-slot": "title",
565
+ title,
522
566
  className: "min-w-0 truncate",
523
- children: files.length === 1 && firstFile ? fileTitle(firstFile) : `${files.length} files`
567
+ children: title
524
568
  }), /* @__PURE__ */ jsxs("div", {
525
569
  "data-control-ui": "code-diff",
526
570
  "data-control-family": "code-diff",
package/dist/ui/code.d.ts CHANGED
@@ -23,7 +23,7 @@ export declare function CodeHeader({ className, ...props }: CodeHeaderProps): im
23
23
  export type CodeTitleProps = Omit<ComponentProps<"span">, "style"> & {
24
24
  style?: CSSProperties & CodeKnobStyle;
25
25
  };
26
- export declare function CodeTitle({ className, ...props }: CodeTitleProps): import("react").JSX.Element;
26
+ export declare function CodeTitle({ className, children, ...props }: CodeTitleProps): import("react").JSX.Element;
27
27
  export type CodeActionsProps = ComponentProps<"div"> & {
28
28
  style?: CSSProperties & CodeKnobStyle;
29
29
  };
@@ -33,8 +33,9 @@ export type CodeCopyProps = Omit<ComponentProps<typeof Button>, "children" | "on
33
33
  children?: ReactNode;
34
34
  copiedLabel?: ReactNode;
35
35
  copiedAriaLabel?: string;
36
+ copyFailedLabel?: string;
36
37
  };
37
- export declare function CodeCopy({ value, copiedLabel, copiedAriaLabel, children, className, "aria-label": ariaLabel, ...props }: CodeCopyProps): import("react").JSX.Element;
38
+ export declare function CodeCopy({ value, copiedLabel, copiedAriaLabel, copyFailedLabel, children, className, "aria-label": ariaLabel, ...props }: CodeCopyProps): import("react").JSX.Element;
38
39
  export type CodeFloatingCopyProps = Omit<CodeCopyProps, "children" | "copiedLabel">;
39
40
  export declare function CodeFloatingCopy({ className, ...props }: CodeFloatingCopyProps): import("react").JSX.Element;
40
41
  export declare function useCodeTokens({ code, lang, tokens, highlight }: {
@@ -50,6 +51,7 @@ export declare function CodeTokenLine({ tokens, plain }: {
50
51
  export type CodeContentProps = Omit<ComponentProps<"div">, "children" | "style"> & {
51
52
  code: string;
52
53
  lang?: string;
54
+ fileName?: string;
53
55
  tokens?: CodeTokenLines | null;
54
56
  highlight?: CodeHighlight;
55
57
  showLineNumbers?: boolean;
@@ -59,7 +61,7 @@ export type CodeContentProps = Omit<ComponentProps<"div">, "children" | "style">
59
61
  virtualize?: boolean;
60
62
  style?: CSSProperties & CodeKnobStyle;
61
63
  };
62
- export declare function CodeContent({ code, lang, tokens, highlight, showLineNumbers, startLine, highlightLines, maxHeight, virtualize, className, ref, style, ...props }: CodeContentProps): import("react").JSX.Element;
64
+ export declare function CodeContent({ code, lang, fileName, tokens, highlight, showLineNumbers, startLine, highlightLines, maxHeight, virtualize, className, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, ref, style, ...props }: CodeContentProps): import("react").JSX.Element;
63
65
  export type CodeEditableProps = Omit<ComponentProps<"textarea">, "defaultValue" | "value" | "style"> & {
64
66
  value?: string;
65
67
  defaultValue?: string;
package/dist/ui/code.js CHANGED
@@ -1,9 +1,10 @@
1
1
  "use client";
2
+ import { useCopyToClipboard } from "../hooks/use-copy-to-clipboard.js";
2
3
  import { cn } from "../lib/cn.js";
3
4
  import { Button } from "./button.js";
4
- import { useCopyToClipboard } from "../hooks/use-copy-to-clipboard.js";
5
- import { highlightToTokens } from "../lib/code-tokens.js";
5
+ import { LiveStatus } from "./live-status.js";
6
6
  import { ScrollArea } from "./scroll-area.js";
7
+ import { highlightToTokens } from "../lib/code-tokens.js";
7
8
  import { Tooltip, TooltipContent, TooltipTrigger } from "./tooltip.js";
8
9
  import { Children, createContext, isValidElement, useContext, useEffect, useMemo, useRef, useState } from "react";
9
10
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
@@ -36,6 +37,7 @@ function Code({ overflow = "scroll", chrome = "standalone", density = "default",
36
37
  "data-control-family": "code",
37
38
  "data-slot": "root",
38
39
  "data-surface": "panel",
40
+ dir: "ltr",
39
41
  "data-chrome": chrome,
40
42
  "data-density": density,
41
43
  "data-header": hasHeader ? "true" : void 0,
@@ -54,13 +56,15 @@ function CodeHeader({ className, ...props }) {
54
56
  ...props
55
57
  });
56
58
  }
57
- function CodeTitle({ className, ...props }) {
59
+ function CodeTitle({ className, children, ...props }) {
58
60
  return /* @__PURE__ */ jsx("span", {
59
61
  "data-control-ui": "code",
60
62
  "data-control-family": "code",
61
63
  "data-slot": "title",
64
+ title: typeof children === "string" ? children : void 0,
62
65
  className: cn("block min-w-0 truncate", className),
63
- ...props
66
+ ...props,
67
+ children
64
68
  });
65
69
  }
66
70
  function CodeActions({ className, ...props }) {
@@ -72,34 +76,39 @@ function CodeActions({ className, ...props }) {
72
76
  ...props
73
77
  });
74
78
  }
75
- function CodeCopy({ value, copiedLabel, copiedAriaLabel = "Copied", children, className, "aria-label": ariaLabel, ...props }) {
76
- const { isCopied, handleCopy } = useCopyToClipboard({ text: value });
79
+ function copyStatusMessage(status, copiedMessage, failedMessage) {
80
+ if (status === "copied") return copiedMessage;
81
+ if (status === "failed") return failedMessage;
82
+ return "";
83
+ }
84
+ function CodeCopy({ value, copiedLabel, copiedAriaLabel = "Copied to clipboard", copyFailedLabel = "Couldn't copy. Select the text and copy it manually.", children, className, "aria-label": ariaLabel, ...props }) {
85
+ const { status, handleCopy } = useCopyToClipboard({ text: value });
77
86
  const isIconOnly = children === void 0;
78
87
  const label = ariaLabel ?? (isIconOnly ? "Copy code" : void 0);
79
88
  const copied = copiedLabel ?? (isIconOnly ? /* @__PURE__ */ jsx(CheckIcon, {
80
89
  "aria-hidden": "true",
81
90
  className: "size-3.5"
82
91
  }) : "Copied");
92
+ const liveStatus = /* @__PURE__ */ jsx(LiveStatus, { message: copyStatusMessage(status, copiedAriaLabel, copyFailedLabel) });
83
93
  const button = /* @__PURE__ */ jsx(Button, {
84
94
  type: "button",
85
95
  variant: "quiet",
86
96
  size: "xs",
87
- "aria-live": "polite",
88
- "aria-label": label && isCopied ? copiedAriaLabel : label,
97
+ "aria-label": label,
89
98
  "data-code-copy": isIconOnly ? "true" : void 0,
90
99
  className,
91
100
  ...props,
92
101
  onClick: handleCopy,
93
- children: isCopied ? copied : children ?? /* @__PURE__ */ jsx(CopyIcon, {
102
+ children: status === "copied" ? copied : children ?? /* @__PURE__ */ jsx(CopyIcon, {
94
103
  "aria-hidden": "true",
95
104
  className: "size-3.5"
96
105
  })
97
106
  });
98
- if (!isIconOnly) return button;
99
- return /* @__PURE__ */ jsxs(Tooltip, { children: [/* @__PURE__ */ jsx(TooltipTrigger, { render: button }), /* @__PURE__ */ jsx(TooltipContent, {
100
- side: "left",
101
- children: label
102
- })] });
107
+ if (!isIconOnly) return /* @__PURE__ */ jsxs(Fragment$1, { children: [button, liveStatus] });
108
+ return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsxs(Tooltip, { children: [/* @__PURE__ */ jsx(TooltipTrigger, { render: button }), /* @__PURE__ */ jsx(TooltipContent, {
109
+ side: "inline-start",
110
+ children: status === "copied" ? copiedAriaLabel : label
111
+ })] }), liveStatus] });
103
112
  }
104
113
  function CodeFloatingCopy({ className, ...props }) {
105
114
  return /* @__PURE__ */ jsx(CodeCopy, {
@@ -175,8 +184,9 @@ function CodeRow({ index, number, tokens, plain, overflow, showLineNumbers, high
175
184
  })]
176
185
  });
177
186
  }
178
- function CodeContent({ code, lang, tokens, highlight = "auto", showLineNumbers = false, startLine = 1, highlightLines, maxHeight = "32rem", virtualize, className, ref, style, ...props }) {
187
+ function CodeContent({ code, lang, fileName, tokens, highlight = "auto", showLineNumbers = false, startLine = 1, highlightLines, maxHeight = "32rem", virtualize, className, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, ref, style, ...props }) {
179
188
  const { density, overflow, hasHeader, copy } = useCodeContext();
189
+ const regionLabel = ariaLabelledby ? ariaLabel : ariaLabel ?? fileName ?? (lang ? `${lang} code` : "Code");
180
190
  const resolvedTokens = useCodeTokens({
181
191
  code,
182
192
  lang,
@@ -193,7 +203,6 @@ function CodeContent({ code, lang, tokens, highlight = "auto", showLineNumbers =
193
203
  else if (ref) ref.current = node;
194
204
  }
195
205
  const shouldVirtualize = virtualize ?? plainLines.length > MAX_STATIC_CODE_LINES;
196
- const useScrollArea = density !== "compact" || overflow !== "wrap";
197
206
  const virtualizer = useVirtualizer({
198
207
  count: plainLines.length,
199
208
  getScrollElement: () => scrollRef.current,
@@ -254,8 +263,10 @@ function CodeContent({ code, lang, tokens, highlight = "auto", showLineNumbers =
254
263
  highlighted: highlightedLineNumbers.has(startLine + index)
255
264
  }, index))
256
265
  });
257
- const content = useScrollArea ? /* @__PURE__ */ jsx(ScrollArea, {
266
+ const content = /* @__PURE__ */ jsx(ScrollArea, {
258
267
  maxHeight,
268
+ "aria-label": regionLabel,
269
+ "aria-labelledby": ariaLabelledby,
259
270
  viewportClassName: className,
260
271
  viewportProps: {
261
272
  ...props,
@@ -266,18 +277,6 @@ function CodeContent({ code, lang, tokens, highlight = "auto", showLineNumbers =
266
277
  },
267
278
  viewportRef: setScrollElement,
268
279
  children: grid
269
- }) : /* @__PURE__ */ jsx("div", {
270
- ref: setScrollElement,
271
- "data-control-ui": "code",
272
- "data-control-family": "code",
273
- "data-slot": "content",
274
- className: cn("overflow-auto", className),
275
- style: {
276
- ...style,
277
- maxHeight
278
- },
279
- ...props,
280
- children: grid
281
280
  });
282
281
  if (hasHeader || !copy) return content;
283
282
  return /* @__PURE__ */ jsxs("div", {
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import { cn } from "../lib/cn.js";
3
- import { jsx } from "react/jsx-runtime";
4
3
  import { useRender } from "@base-ui/react/use-render";
4
+ import { jsx } from "react/jsx-runtime";
5
5
  import { Collapsible as Collapsible$1 } from "@base-ui/react/collapsible";
6
6
  //#region src/ui/collapsible.tsx
7
7
  function CollapsibleTriggerElement({ triggerProps, open, render, className, children }) {
@@ -55,6 +55,7 @@ export type ColorPickerInputProps = Omit<Omit<ComponentProps<"input">, "value" |
55
55
  style?: CSSProperties & ColorPickerKnobStyle;
56
56
  } & {
57
57
  size?: ControlSize;
58
+ invalidLabel?: string;
58
59
  };
59
60
  export type ColorPickerFormatSelectProps = {
60
61
  formats?: ColorFormat[];
@@ -94,6 +95,8 @@ export type ColorPickerContrastProps = Omit<Omit<ComponentProps<"div">, "childre
94
95
  style?: CSSProperties & ColorPickerKnobStyle;
95
96
  } & {
96
97
  background?: string;
98
+ passLabel?: string;
99
+ failLabel?: string;
97
100
  };
98
101
  export type ColorPickerOutputProps = Omit<Omit<ComponentProps<"div">, "children">, "style"> & {
99
102
  style?: CSSProperties & ColorPickerKnobStyle;
@@ -112,7 +115,7 @@ export declare function ColorPickerAreaThumb({ className, ...props }: ColorPicke
112
115
  export declare function ColorPickerHue({ className, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, ...props }: ColorPickerHueProps): import("react").JSX.Element;
113
116
  export declare function ColorPickerAlpha({ className, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, ...props }: ColorPickerAlphaProps): import("react").JSX.Element | null;
114
117
  export declare function ColorPickerWheel({ className, style, ...props }: ColorPickerWheelProps): import("react").JSX.Element;
115
- export declare function ColorPickerInput({ size, className, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, ...props }: ColorPickerInputProps): import("react").JSX.Element;
118
+ export declare function ColorPickerInput({ size, className, invalidLabel, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, "aria-describedby": ariaDescribedBy, onFocus, onBlur, onKeyDown, ...props }: ColorPickerInputProps): import("react").JSX.Element;
116
119
  export declare function ColorPickerFormatSelect({ formats, size, className, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, style }: ColorPickerFormatSelectProps): import("react").JSX.Element;
117
120
  export declare function ColorPickerChannels({ className, children, ...props }: ColorPickerChannelsProps): import("react").JSX.Element;
118
121
  export declare function ColorPickerChannel({ channel, label, className, "aria-label": ariaLabel, ...props }: ColorPickerChannelProps): import("react").JSX.Element | null;
@@ -131,6 +134,6 @@ export declare function ColorPickerEyeDropper({ className, children, ...props }:
131
134
  export declare function ColorPickerSwatches({ colors, label, className, children, ...props }: ColorPickerSwatchesProps): import("react").JSX.Element;
132
135
  export declare function ColorPickerSwatch({ color, className, "aria-label": ariaLabel, ...props }: ColorPickerSwatchProps): import("react").JSX.Element;
133
136
  export declare function ColorPickerSwatchAdd({ onAdd, className, children, ...props }: ColorPickerSwatchAddProps): import("react").JSX.Element;
134
- export declare function ColorPickerContrast({ background, className, ...props }: ColorPickerContrastProps): import("react").JSX.Element | null;
137
+ export declare function ColorPickerContrast({ background, passLabel, failLabel, className, ...props }: ColorPickerContrastProps): import("react").JSX.Element | null;
135
138
  export declare function ColorPickerOutput({ className, children, renderValue, ...props }: ColorPickerOutputProps): import("react").JSX.Element;
136
139
  //#endregion