@ctrl-ui/react 0.8.7 → 0.8.9

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 (341) 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 +39 -39
  8. package/dist/blocks/design-canvas.d.ts +5 -1
  9. package/dist/blocks/design-canvas.js +198 -92
  10. package/dist/blocks/discussion.d.ts +28 -0
  11. package/dist/blocks/discussion.js +67 -0
  12. package/dist/blocks/file-explorer-data.d.ts +1 -0
  13. package/dist/blocks/file-explorer-data.js +4 -1
  14. package/dist/blocks/file-explorer.d.ts +9 -1
  15. package/dist/blocks/file-explorer.js +461 -192
  16. package/dist/blocks/settings.d.ts +2 -1
  17. package/dist/blocks/settings.js +101 -79
  18. package/dist/blocks/team-chat.d.ts +12 -0
  19. package/dist/blocks/team-chat.js +26 -0
  20. package/dist/blocks/theme-toggle.js +23 -31
  21. package/dist/chat-composer-attachment.d.ts +4 -1
  22. package/dist/chat-composer-attachment.js +35 -10
  23. package/dist/chat-composer-editor/extensions/mention.d.ts +5 -1
  24. package/dist/chat-composer-editor/extensions/mention.js +59 -28
  25. package/dist/chat-composer-editor/ghost.js +2 -4
  26. package/dist/chat-composer-editor/types.d.ts +5 -0
  27. package/dist/chat-composer-editor.d.ts +1 -1
  28. package/dist/chat-composer-editor.js +57 -30
  29. package/dist/chat-composer.d.ts +13 -32
  30. package/dist/chat-composer.js +52 -12
  31. package/dist/chat-layout.d.ts +19 -0
  32. package/dist/chat-layout.js +91 -40
  33. package/dist/chat-message/social.d.ts +26 -0
  34. package/dist/chat-message/social.js +122 -0
  35. package/dist/chat-message.d.ts +28 -29
  36. package/dist/chat-message.js +106 -25
  37. package/dist/context.d.ts +2 -2
  38. package/dist/context.js +38 -23
  39. package/dist/dynamic-notification-canvas-loop.d.ts +24 -0
  40. package/dist/dynamic-notification-canvas-loop.js +113 -0
  41. package/dist/dynamic-notification-glass.js +23 -114
  42. package/dist/dynamic-notification-liquid.js +14 -118
  43. package/dist/dynamic-notification.d.ts +16 -8
  44. package/dist/dynamic-notification.js +85 -22
  45. package/dist/email/email-brand.d.ts +7 -4
  46. package/dist/email/email-brand.js +9 -6
  47. package/dist/email/email-code.d.ts +3 -2
  48. package/dist/email/email-code.js +11 -9
  49. package/dist/email/email-footer.d.ts +5 -3
  50. package/dist/email/email-footer.js +11 -5
  51. package/dist/email/email.d.ts +31 -9
  52. package/dist/email/email.js +50 -26
  53. package/dist/email/templates.d.ts +10 -9
  54. package/dist/email/templates.js +102 -38
  55. package/dist/email/theme.js +1 -1
  56. package/dist/environment-variables.d.ts +4 -2
  57. package/dist/environment-variables.js +52 -32
  58. package/dist/filter-bar/editor.js +20 -8
  59. package/dist/filter-bar/model.d.ts +1 -0
  60. package/dist/filter-bar/model.js +10 -1
  61. package/dist/filter-bar/motion.js +4 -4
  62. package/dist/filter-bar/parts.js +19 -8
  63. package/dist/filter-bar/types.d.ts +1 -0
  64. package/dist/filter-bar.js +19 -13
  65. package/dist/hooks/use-audio-recorder.js +12 -6
  66. package/dist/hooks/use-chat-composer.d.ts +19 -7
  67. package/dist/hooks/use-chat-composer.js +32 -5
  68. package/dist/hooks/use-chat-message.d.ts +28 -2
  69. package/dist/hooks/use-chat-message.js +41 -10
  70. package/dist/hooks/use-chat-thread-scroll.js +43 -7
  71. package/dist/hooks/use-color-area.d.ts +3 -3
  72. package/dist/hooks/use-color-area.js +13 -12
  73. package/dist/hooks/use-copy-to-clipboard.d.ts +2 -1
  74. package/dist/hooks/use-copy-to-clipboard.js +20 -20
  75. package/dist/hooks/use-dynamic-notification.d.ts +6 -2
  76. package/dist/hooks/use-dynamic-notification.js +26 -10
  77. package/dist/hooks/use-mobile.d.ts +3 -2
  78. package/dist/hooks/use-mobile.js +8 -4
  79. package/dist/hooks/use-textarea-trigger-menu.js +2 -1
  80. package/dist/hooks/use-trigger-menu.d.ts +54 -0
  81. package/dist/hooks/use-trigger-menu.js +102 -47
  82. package/dist/hooks/use-user-ask.d.ts +2 -0
  83. package/dist/hooks/use-user-ask.js +35 -41
  84. package/dist/inline-attachment.d.ts +6 -2
  85. package/dist/inline-attachment.js +36 -15
  86. package/dist/inline-citation.d.ts +12 -5
  87. package/dist/inline-citation.js +25 -16
  88. package/dist/knob-contracts/audio-recorder-knobs.d.ts +1 -1
  89. package/dist/knob-contracts/audio-recorder-knobs.js +2 -1
  90. package/dist/knob-contracts/audio-visualizer-knobs.d.ts +1 -1
  91. package/dist/knob-contracts/audio-visualizer-knobs.js +2 -1
  92. package/dist/knob-contracts/avatar-knobs.d.ts +1 -1
  93. package/dist/knob-contracts/avatar-knobs.js +6 -1
  94. package/dist/knob-contracts/badge-knobs.d.ts +1 -1
  95. package/dist/knob-contracts/badge-knobs.js +2 -1
  96. package/dist/knob-contracts/breadcrumb-knobs.d.ts +4 -0
  97. package/dist/knob-contracts/breadcrumb-knobs.js +8 -0
  98. package/dist/knob-contracts/button-knobs.d.ts +1 -1
  99. package/dist/knob-contracts/button-knobs.js +1 -0
  100. package/dist/knob-contracts/chat-message-knobs.d.ts +1 -1
  101. package/dist/knob-contracts/chat-message-knobs.js +8 -1
  102. package/dist/knob-contracts/code-diff-knobs.d.ts +1 -1
  103. package/dist/knob-contracts/code-diff-knobs.js +2 -0
  104. package/dist/knob-contracts/code-knobs.d.ts +1 -1
  105. package/dist/knob-contracts/code-knobs.js +2 -1
  106. package/dist/knob-contracts/dynamic-notification-knobs.d.ts +1 -1
  107. package/dist/knob-contracts/dynamic-notification-knobs.js +2 -0
  108. package/dist/knob-contracts/emoji-picker-knobs.d.ts +4 -0
  109. package/dist/knob-contracts/emoji-picker-knobs.js +10 -0
  110. package/dist/knob-contracts/field-knobs.d.ts +1 -1
  111. package/dist/knob-contracts/field-knobs.js +5 -1
  112. package/dist/knob-contracts/filter-bar-knobs.d.ts +1 -1
  113. package/dist/knob-contracts/filter-bar-knobs.js +1 -2
  114. package/dist/knob-contracts/markdown-knobs.d.ts +1 -1
  115. package/dist/knob-contracts/markdown-knobs.js +3 -1
  116. package/dist/knob-contracts/page-layout-knobs.d.ts +1 -1
  117. package/dist/knob-contracts/page-layout-knobs.js +2 -1
  118. package/dist/knob-contracts/popup-knobs.d.ts +1 -1
  119. package/dist/knob-contracts/popup-knobs.js +27 -0
  120. package/dist/knob-contracts/range-knobs.d.ts +1 -1
  121. package/dist/knob-contracts/range-knobs.js +1 -0
  122. package/dist/knob-contracts/rich-tooltip-knobs.d.ts +1 -1
  123. package/dist/knob-contracts/rich-tooltip-knobs.js +2 -1
  124. package/dist/knob-contracts/sidebar-knobs.d.ts +1 -1
  125. package/dist/knob-contracts/sidebar-knobs.js +27 -2
  126. package/dist/knob-contracts/spinner-knobs.d.ts +1 -1
  127. package/dist/knob-contracts/spinner-knobs.js +1 -1
  128. package/dist/knob-contracts/stepper-knobs.d.ts +1 -1
  129. package/dist/knob-contracts/stepper-knobs.js +4 -1
  130. package/dist/knob-contracts/switch-knobs.d.ts +1 -1
  131. package/dist/knob-contracts/switch-knobs.js +5 -0
  132. package/dist/knob-contracts/table-of-contents-knobs.d.ts +1 -1
  133. package/dist/knob-contracts/table-of-contents-knobs.js +2 -1
  134. package/dist/knob-contracts/tabs-knobs.d.ts +1 -1
  135. package/dist/knob-contracts/tabs-knobs.js +1 -0
  136. package/dist/knob-contracts/tree-knobs.d.ts +1 -1
  137. package/dist/knob-contracts/tree-knobs.js +2 -1
  138. package/dist/lib/cn.js +0 -4
  139. package/dist/lib/contrast.d.ts +1 -0
  140. package/dist/lib/contrast.js +17 -5
  141. package/dist/lib/dropzone-validation.js +41 -28
  142. package/dist/lib/env-file.d.ts +1 -1
  143. package/dist/lib/env-file.js +5 -5
  144. package/dist/lib/motion.d.ts +4 -0
  145. package/dist/lib/motion.js +15 -0
  146. package/dist/lib/trigger-detect.js +6 -8
  147. package/dist/markdown-block.js +2 -1
  148. package/dist/popup-parts.d.ts +8 -0
  149. package/dist/popup-parts.js +43 -0
  150. package/dist/source-badge.js +3 -1
  151. package/dist/styles/code.css +0 -2
  152. package/dist/styles/effects.css +6 -32
  153. package/dist/styles/index.css +10 -5
  154. package/dist/styles/recipes/accordion.css +9 -6
  155. package/dist/styles/recipes/action-bar.css +0 -15
  156. package/dist/styles/recipes/activity.css +5 -11
  157. package/dist/styles/recipes/alert.css +4 -4
  158. package/dist/styles/recipes/audio-recorder.css +15 -3
  159. package/dist/styles/recipes/audio-visualizer.css +13 -2
  160. package/dist/styles/recipes/avatar.css +78 -1
  161. package/dist/styles/recipes/badge.css +14 -4
  162. package/dist/styles/recipes/breadcrumb.css +77 -0
  163. package/dist/styles/recipes/button-group.css +5 -7
  164. package/dist/styles/recipes/button-states.css +66 -0
  165. package/dist/styles/recipes/button.css +24 -83
  166. package/dist/styles/recipes/calendar.css +17 -23
  167. package/dist/styles/recipes/card.css +2 -2
  168. package/dist/styles/recipes/chat-composer-attachment.css +9 -3
  169. package/dist/styles/recipes/chat-composer.css +7 -10
  170. package/dist/styles/recipes/chat-layout.css +35 -0
  171. package/dist/styles/recipes/chat-message-social.css +123 -0
  172. package/dist/styles/recipes/chat-message.css +157 -37
  173. package/dist/styles/recipes/choice.css +18 -21
  174. package/dist/styles/recipes/code-diff.css +46 -33
  175. package/dist/styles/recipes/code.css +36 -16
  176. package/dist/styles/recipes/collapsible.css +7 -2
  177. package/dist/styles/recipes/color-picker-details.css +3 -4
  178. package/dist/styles/recipes/color-picker-values.css +9 -8
  179. package/dist/styles/recipes/color-picker.css +11 -2
  180. package/dist/styles/recipes/context.css +3 -3
  181. package/dist/styles/recipes/dockable-panel.css +7 -4
  182. package/dist/styles/recipes/dropzone.css +7 -8
  183. package/dist/styles/recipes/dynamic-notification-input.css +8 -5
  184. package/dist/styles/recipes/dynamic-notification-motion.css +12 -21
  185. package/dist/styles/recipes/dynamic-notification.css +40 -26
  186. package/dist/styles/recipes/emoji-picker.css +132 -0
  187. package/dist/styles/recipes/empty.css +5 -4
  188. package/dist/styles/recipes/environment-variables.css +4 -15
  189. package/dist/styles/recipes/field-parts.css +30 -24
  190. package/dist/styles/recipes/field.css +61 -26
  191. package/dist/styles/recipes/filter-bar.css +18 -31
  192. package/dist/styles/recipes/gradient-editor.css +18 -7
  193. package/dist/styles/recipes/infinite-canvas.css +0 -1
  194. package/dist/styles/recipes/inline-attachment.css +3 -3
  195. package/dist/styles/recipes/inline-citation.css +10 -4
  196. package/dist/styles/recipes/item.css +23 -9
  197. package/dist/styles/recipes/markdown-block.css +5 -4
  198. package/dist/styles/recipes/markdown.css +68 -26
  199. package/dist/styles/recipes/morphing-panel.css +8 -8
  200. package/dist/styles/recipes/page-layout.css +20 -12
  201. package/dist/styles/recipes/pagination.css +4 -5
  202. package/dist/styles/recipes/phone-input.css +12 -8
  203. package/dist/styles/recipes/popup-controls.css +166 -33
  204. package/dist/styles/recipes/popup-drawer.css +3 -14
  205. package/dist/styles/recipes/popup-lists.css +128 -27
  206. package/dist/styles/recipes/popup-motion.css +4 -45
  207. package/dist/styles/recipes/popup-toast.css +55 -26
  208. package/dist/styles/recipes/popup.css +139 -141
  209. package/dist/styles/recipes/range.css +54 -18
  210. package/dist/styles/recipes/resizable.css +2 -7
  211. package/dist/styles/recipes/rich-tooltip.css +24 -34
  212. package/dist/styles/recipes/scroll-area.css +8 -1
  213. package/dist/styles/recipes/sidebar-menu.css +166 -34
  214. package/dist/styles/recipes/sidebar-parts.css +192 -0
  215. package/dist/styles/recipes/sidebar.css +188 -128
  216. package/dist/styles/recipes/source-badge.css +1 -1
  217. package/dist/styles/recipes/spinner.css +8 -1
  218. package/dist/styles/recipes/stepper.css +31 -13
  219. package/dist/styles/recipes/switch.css +68 -23
  220. package/dist/styles/recipes/table-of-contents.css +9 -1
  221. package/dist/styles/recipes/table.css +14 -10
  222. package/dist/styles/recipes/tabs.css +17 -12
  223. package/dist/styles/recipes/task-list.css +7 -14
  224. package/dist/styles/recipes/thread-rail.css +42 -19
  225. package/dist/styles/recipes/timeline.css +2 -0
  226. package/dist/styles/recipes/toolbar.css +27 -25
  227. package/dist/styles/recipes/track-highlight.css +10 -7
  228. package/dist/styles/recipes/tree.css +31 -4
  229. package/dist/styles/recipes/user-ask-details.css +0 -1
  230. package/dist/styles/recipes/user-ask.css +4 -4
  231. package/dist/styles/theme.css +37 -16
  232. package/dist/task-list.d.ts +4 -1
  233. package/dist/task-list.js +24 -8
  234. package/dist/thread-rail.d.ts +1 -1
  235. package/dist/thread-rail.js +61 -19
  236. package/dist/transcript-divider.js +2 -1
  237. package/dist/ui/alert.d.ts +3 -1
  238. package/dist/ui/alert.js +14 -8
  239. package/dist/ui/autocomplete.js +3 -1
  240. package/dist/ui/avatar.d.ts +8 -0
  241. package/dist/ui/avatar.js +23 -3
  242. package/dist/ui/badge.js +1 -1
  243. package/dist/ui/breadcrumb.d.ts +27 -0
  244. package/dist/ui/breadcrumb.js +88 -0
  245. package/dist/ui/button.d.ts +2 -1
  246. package/dist/ui/button.js +1 -1
  247. package/dist/ui/calendar.js +2 -2
  248. package/dist/ui/card.d.ts +3 -1
  249. package/dist/ui/card.js +12 -7
  250. package/dist/ui/checkbox.d.ts +2 -0
  251. package/dist/ui/code-diff.d.ts +1 -1
  252. package/dist/ui/code-diff.js +71 -27
  253. package/dist/ui/code.d.ts +5 -3
  254. package/dist/ui/code.js +26 -27
  255. package/dist/ui/color-picker.d.ts +5 -2
  256. package/dist/ui/color-picker.js +84 -36
  257. package/dist/ui/combobox-disabled-selection.d.ts +1 -2
  258. package/dist/ui/combobox-disabled-selection.js +7 -9
  259. package/dist/ui/combobox.js +13 -5
  260. package/dist/ui/command.d.ts +8 -2
  261. package/dist/ui/command.js +30 -14
  262. package/dist/ui/context-menu.js +3 -0
  263. package/dist/ui/dialog.d.ts +2 -1
  264. package/dist/ui/dialog.js +3 -22
  265. package/dist/ui/dockable-panel-geometry.d.ts +1 -0
  266. package/dist/ui/dockable-panel-geometry.js +7 -1
  267. package/dist/ui/dockable-panel.d.ts +9 -6
  268. package/dist/ui/dockable-panel.js +63 -23
  269. package/dist/ui/dropdown-menu.js +4 -3
  270. package/dist/ui/dropzone.d.ts +2 -2
  271. package/dist/ui/dropzone.js +75 -16
  272. package/dist/ui/emoji-picker.d.ts +18 -0
  273. package/dist/ui/emoji-picker.js +136 -0
  274. package/dist/ui/empty.d.ts +3 -1
  275. package/dist/ui/empty.js +12 -7
  276. package/dist/ui/gradient-editor.d.ts +1 -1
  277. package/dist/ui/gradient-editor.js +37 -21
  278. package/dist/ui/infinite-canvas.d.ts +3 -2
  279. package/dist/ui/infinite-canvas.js +63 -19
  280. package/dist/ui/input-group.d.ts +0 -3
  281. package/dist/ui/input-group.js +3 -13
  282. package/dist/ui/input-otp.d.ts +1 -1
  283. package/dist/ui/input-otp.js +32 -15
  284. package/dist/ui/input.js +4 -4
  285. package/dist/ui/item.d.ts +2 -1
  286. package/dist/ui/item.js +11 -7
  287. package/dist/ui/live-status.d.ts +7 -0
  288. package/dist/ui/live-status.js +17 -0
  289. package/dist/ui/markdown-elements.d.ts +6 -0
  290. package/dist/ui/markdown-elements.js +31 -1
  291. package/dist/ui/menubar.js +2 -2
  292. package/dist/ui/morphing-panel.js +2 -1
  293. package/dist/ui/native-select.d.ts +1 -1
  294. package/dist/ui/native-select.js +24 -11
  295. package/dist/ui/page-layout.d.ts +2 -2
  296. package/dist/ui/page-layout.js +2 -4
  297. package/dist/ui/pagination.d.ts +7 -5
  298. package/dist/ui/pagination.js +19 -13
  299. package/dist/ui/phone-input.d.ts +1 -0
  300. package/dist/ui/phone-input.js +56 -58
  301. package/dist/ui/radio-group.d.ts +2 -0
  302. package/dist/ui/resizable.d.ts +3 -2
  303. package/dist/ui/resizable.js +5 -3
  304. package/dist/ui/responsive-dialog.d.ts +1 -1
  305. package/dist/ui/responsive-dialog.js +4 -21
  306. package/dist/ui/rich-tooltip.d.ts +10 -4
  307. package/dist/ui/rich-tooltip.js +81 -33
  308. package/dist/ui/scroll-area.d.ts +1 -1
  309. package/dist/ui/scroll-area.js +43 -28
  310. package/dist/ui/sidebar-menu.d.ts +5 -1
  311. package/dist/ui/sidebar-menu.js +34 -34
  312. package/dist/ui/sidebar-provider.d.ts +10 -1
  313. package/dist/ui/sidebar-provider.js +38 -13
  314. package/dist/ui/sidebar-resize-rail.js +7 -3
  315. package/dist/ui/sidebar.d.ts +11 -6
  316. package/dist/ui/sidebar.js +48 -24
  317. package/dist/ui/slider.js +31 -22
  318. package/dist/ui/spinner.d.ts +3 -2
  319. package/dist/ui/spinner.js +3 -2
  320. package/dist/ui/stepper.d.ts +8 -1
  321. package/dist/ui/stepper.js +74 -25
  322. package/dist/ui/switch.d.ts +1 -0
  323. package/dist/ui/table-of-contents.d.ts +2 -2
  324. package/dist/ui/table-of-contents.js +20 -8
  325. package/dist/ui/table.js +4 -2
  326. package/dist/ui/textarea.d.ts +1 -1
  327. package/dist/ui/textarea.js +20 -9
  328. package/dist/ui/timeline.d.ts +3 -1
  329. package/dist/ui/timeline.js +17 -9
  330. package/dist/ui/toast.d.ts +11 -5
  331. package/dist/ui/toast.js +100 -54
  332. package/dist/ui/toolbar.d.ts +2 -1
  333. package/dist/ui/toolbar.js +3 -1
  334. package/dist/ui/tooltip.js +3 -20
  335. package/dist/ui/tree.js +120 -80
  336. package/dist/ui/trigger-menu.js +1 -0
  337. package/dist/user-ask.d.ts +10 -5
  338. package/dist/user-ask.js +31 -11
  339. package/package.json +5 -1
  340. package/dist/hooks/use-keyboard-navigation.d.ts +0 -3
  341. package/dist/hooks/use-keyboard-navigation.js +0 -22
@@ -1,10 +1,9 @@
1
1
  "use client";
2
2
  import { cn } from "../lib/cn.js";
3
- import { useEffect, useRef, useState } from "react";
3
+ import { useEffect, useRef, useState, useSyncExternalStore } from "react";
4
4
  import { jsx, jsxs } from "react/jsx-runtime";
5
5
  //#region src/ui/table-of-contents.tsx
6
6
  const tableOfContentsVariants = ["range", "progress"];
7
- const DETECTION_MARGIN = "-80px 0px -20% 0px";
8
7
  function getScrollContainer(el) {
9
8
  let node = el.parentElement;
10
9
  while (node) {
@@ -13,7 +12,7 @@ function getScrollContainer(el) {
13
12
  }
14
13
  return null;
15
14
  }
16
- function useVisibleSections(ids) {
15
+ function useVisibleSections(ids, knobSourceRef) {
17
16
  const [visibleState, setVisibleState] = useState({
18
17
  idsKey: "",
19
18
  visibleIds: []
@@ -23,6 +22,8 @@ function useVisibleSections(ids) {
23
22
  const elements = (idsKey ? idsKey.split("|") : []).map((id) => document.getElementById(id)).filter((el) => el !== null);
24
23
  const firstElement = elements[0];
25
24
  if (!firstElement) return;
25
+ const knobSource = knobSourceRef.current;
26
+ const scrollInset = knobSource ? readLengthKnob(getComputedStyle(knobSource), "--cui-table-of-contents-scroll-inset") : 0;
26
27
  const order = new Map(elements.map((el, index) => [el.id, index]));
27
28
  const visible = /* @__PURE__ */ new Set();
28
29
  const observer = new IntersectionObserver((entries) => {
@@ -34,14 +35,21 @@ function useVisibleSections(ids) {
34
35
  });
35
36
  }, {
36
37
  root: getScrollContainer(firstElement),
37
- rootMargin: DETECTION_MARGIN,
38
+ rootMargin: `-${scrollInset}px 0px -20% 0px`,
38
39
  threshold: 0
39
40
  });
40
41
  for (const el of elements) observer.observe(el);
41
42
  return () => observer.disconnect();
42
- }, [idsKey]);
43
+ }, [idsKey, knobSourceRef]);
43
44
  return visibleState.idsKey === idsKey ? visibleState.visibleIds : [];
44
45
  }
46
+ function subscribeToHash(onChange) {
47
+ window.addEventListener("hashchange", onChange);
48
+ return () => window.removeEventListener("hashchange", onChange);
49
+ }
50
+ function useLocationHash() {
51
+ return useSyncExternalStore(subscribeToHash, () => window.location.hash, () => "");
52
+ }
45
53
  function collectLevels(items, fallbackLevel = 2) {
46
54
  return items.flatMap((item) => {
47
55
  const level = item.level ?? fallbackLevel;
@@ -151,8 +159,10 @@ function TableOfContents({ items, label = "On this page", variant = "range", ind
151
159
  const normalizedItems = normalizeItems(items, Math.min(...collectLevels(items), 2));
152
160
  const flatItems = flattenItems(normalizedItems);
153
161
  const targetIds = flatItems.map((item) => item.href.replace(/^#/, ""));
154
- const activeItems = findActiveItems(useVisibleSections(targetIds), flatItems, targetIds);
162
+ const activeItems = findActiveItems(useVisibleSections(targetIds, trackRef), flatItems, targetIds);
155
163
  const activeHrefs = new Set(activeItems.map((item) => item.href));
164
+ const locationHash = useLocationHash();
165
+ const currentHref = activeHrefs.has(locationHash) ? locationHash : activeItems[0]?.href;
156
166
  const rail = useRailGeometry(trackRef, itemElements);
157
167
  const hasActiveSection = activeItems.length > 0;
158
168
  if (items.length === 0) return null;
@@ -197,6 +207,7 @@ function TableOfContents({ items, label = "On this page", variant = "range", ind
197
207
  /* @__PURE__ */ jsx(TocList, {
198
208
  items: normalizedItems,
199
209
  activeHrefs,
210
+ currentHref,
200
211
  itemElements,
201
212
  root: true
202
213
  }),
@@ -214,7 +225,7 @@ function TableOfContents({ items, label = "On this page", variant = "range", ind
214
225
  })]
215
226
  });
216
227
  }
217
- function TocList({ items, activeHrefs, itemElements, root = false }) {
228
+ function TocList({ items, activeHrefs, currentHref, itemElements, root = false }) {
218
229
  return /* @__PURE__ */ jsx("ul", {
219
230
  "data-control-ui": "table-of-contents",
220
231
  "data-control-family": "table-of-contents",
@@ -237,7 +248,7 @@ function TocList({ items, activeHrefs, itemElements, root = false }) {
237
248
  "data-active": isActive || void 0,
238
249
  "data-level": item.level,
239
250
  "data-depth": item.depth,
240
- "aria-current": isActive ? "location" : void 0,
251
+ "aria-current": item.href === currentHref ? "location" : void 0,
241
252
  href: item.href,
242
253
  className: "block",
243
254
  style: itemStyle,
@@ -245,6 +256,7 @@ function TocList({ items, activeHrefs, itemElements, root = false }) {
245
256
  }), item.children && /* @__PURE__ */ jsx(TocList, {
246
257
  items: item.children,
247
258
  activeHrefs,
259
+ currentHref,
248
260
  itemElements
249
261
  })] }, item.href);
250
262
  })
package/dist/ui/table.js CHANGED
@@ -10,6 +10,8 @@ function Table({ className, ...props }) {
10
10
  className: "relative w-full",
11
11
  children: /* @__PURE__ */ jsx(ScrollArea, {
12
12
  lockAxis: "y",
13
+ "aria-label": props["aria-label"],
14
+ "aria-labelledby": props["aria-labelledby"],
13
15
  children: /* @__PURE__ */ jsx("table", {
14
16
  "data-control-ui": "table",
15
17
  "data-control-family": "table",
@@ -61,7 +63,7 @@ function TableHead({ className, ...props }) {
61
63
  "data-control-ui": "table",
62
64
  "data-control-family": "table",
63
65
  "data-slot": "head",
64
- className: cn("whitespace-nowrap align-middle [&:has([role=checkbox])]:pr-0", className),
66
+ className: cn("whitespace-nowrap align-middle [&:has([role=checkbox])]:pe-0", className),
65
67
  ...props
66
68
  });
67
69
  }
@@ -70,7 +72,7 @@ function TableCell({ className, ...props }) {
70
72
  "data-control-ui": "table",
71
73
  "data-control-family": "table",
72
74
  "data-slot": "cell",
73
- className: cn("whitespace-nowrap align-middle [&:has([role=checkbox])]:pr-0", className),
75
+ className: cn("whitespace-nowrap align-middle [&:has([role=checkbox])]:pe-0", className),
74
76
  ...props
75
77
  });
76
78
  }
@@ -4,5 +4,5 @@ import { CSSProperties, ComponentProps } from "react";
4
4
  export type TextareaProps = Omit<ComponentProps<"textarea">, "style"> & {
5
5
  style?: CSSProperties & FieldKnobStyle;
6
6
  };
7
- export declare function Textarea({ className, ...props }: TextareaProps): import("react").JSX.Element;
7
+ export declare function Textarea({ ref, id, name, value, defaultValue, disabled, autoFocus, className, ...props }: TextareaProps): import("react").JSX.Element;
8
8
  //#endregion
@@ -1,15 +1,26 @@
1
+ "use client";
1
2
  import { cn } from "../lib/cn.js";
2
3
  import { jsx } from "react/jsx-runtime";
4
+ import { Input } from "@base-ui/react/input";
3
5
  //#region src/ui/textarea.tsx
4
- function Textarea({ className, ...props }) {
5
- return /* @__PURE__ */ jsx("textarea", {
6
- "data-control-ui": "textarea",
7
- "data-field-kind": "textarea",
8
- "data-slot": "root",
9
- "data-control-family": "field",
10
- "data-control": "true",
11
- className: cn("field-sizing-content w-full min-w-0 resize-none", className),
12
- ...props
6
+ function Textarea({ ref, id, name, value, defaultValue, disabled, autoFocus, className, ...props }) {
7
+ return /* @__PURE__ */ jsx(Input, {
8
+ ref,
9
+ id,
10
+ name,
11
+ value,
12
+ defaultValue,
13
+ disabled,
14
+ autoFocus,
15
+ render: /* @__PURE__ */ jsx("textarea", {
16
+ ...props,
17
+ "data-control-ui": "textarea",
18
+ "data-field-kind": "textarea",
19
+ "data-slot": "root",
20
+ "data-control-family": "field",
21
+ "data-control": "true",
22
+ className: cn("field-sizing-content w-full min-w-0 resize-none", className)
23
+ })
13
24
  });
14
25
  }
15
26
  //#endregion
@@ -1,3 +1,4 @@
1
+ import { RenderProp } from "../control-props.js";
1
2
  import { TimelineKnobStyle } from "../knob-contracts/timeline-knobs.js";
2
3
  import { CSSProperties, ComponentProps } from "react";
3
4
  //#region src/ui/timeline.d.ts
@@ -20,6 +21,7 @@ export type TimelineContentProps = ComponentProps<"div"> & {
20
21
  style?: CSSProperties & TimelineKnobStyle;
21
22
  };
22
23
  export type TimelineTitleProps = Omit<ComponentProps<"div">, "style"> & {
24
+ render?: RenderProp<ComponentProps<"div">>;
23
25
  style?: CSSProperties & TimelineKnobStyle;
24
26
  };
25
27
  export type TimelineDescriptionProps = Omit<ComponentProps<"div">, "style"> & {
@@ -33,7 +35,7 @@ export declare function TimelineItem({ state, className, ...props }: TimelineIte
33
35
  export declare function TimelineIndicator({ className, ...props }: TimelineIndicatorProps): import("react").JSX.Element;
34
36
  export declare function TimelineSeparator({ className, ...props }: TimelineSeparatorProps): import("react").JSX.Element;
35
37
  export declare function TimelineContent({ className, ...props }: TimelineContentProps): import("react").JSX.Element;
36
- export declare function TimelineTitle({ className, ...props }: TimelineTitleProps): import("react").JSX.Element;
38
+ export declare function TimelineTitle({ render, className, ...props }: TimelineTitleProps): import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
37
39
  export declare function TimelineDescription({ className, ...props }: TimelineDescriptionProps): import("react").JSX.Element;
38
40
  export declare function TimelineMeta({ className, ...props }: TimelineMetaProps): import("react").JSX.Element;
39
41
  //#endregion
@@ -1,5 +1,7 @@
1
+ "use client";
1
2
  import { cn } from "../lib/cn.js";
2
3
  import { jsx } from "react/jsx-runtime";
4
+ import { useRender } from "@base-ui/react/use-render";
3
5
  //#region src/ui/timeline.tsx
4
6
  function Timeline({ className, ...props }) {
5
7
  return /* @__PURE__ */ jsx("ol", {
@@ -16,13 +18,15 @@ function TimelineItem({ state = "neutral", className, ...props }) {
16
18
  "data-control-family": "timeline",
17
19
  "data-slot": "item",
18
20
  "data-state": state,
21
+ "aria-current": state === "running" ? "step" : void 0,
19
22
  ...props,
20
23
  className: cn("group/timeline-item relative grid min-w-0 grid-cols-[1rem_minmax(0,1fr)]", className)
21
24
  });
22
25
  }
23
26
  function TimelineIndicator({ className, ...props }) {
24
27
  return /* @__PURE__ */ jsx("span", {
25
- "aria-hidden": "true",
28
+ role: props["aria-label"] ? "img" : void 0,
29
+ "aria-hidden": props["aria-label"] ? void 0 : true,
26
30
  "data-control-ui": "timeline",
27
31
  "data-control-family": "timeline",
28
32
  "data-slot": "indicator",
@@ -37,7 +41,7 @@ function TimelineSeparator({ className, ...props }) {
37
41
  "data-control-family": "timeline",
38
42
  "data-slot": "separator",
39
43
  ...props,
40
- className: cn("absolute top-5 bottom-0 left-[calc(0.5rem-0.5px)] col-start-1 w-px group-last/timeline-item:hidden", className)
44
+ className: cn("absolute top-5 bottom-0 start-[calc(0.5rem-0.5px)] col-start-1 w-px group-last/timeline-item:hidden", className)
41
45
  });
42
46
  }
43
47
  function TimelineContent({ className, ...props }) {
@@ -49,13 +53,17 @@ function TimelineContent({ className, ...props }) {
49
53
  className: cn("col-start-2 row-start-1 grid min-w-0", className)
50
54
  });
51
55
  }
52
- function TimelineTitle({ className, ...props }) {
53
- return /* @__PURE__ */ jsx("div", {
54
- "data-control-ui": "timeline",
55
- "data-control-family": "timeline",
56
- "data-slot": "title",
57
- ...props,
58
- className: cn("min-w-0", className)
56
+ function TimelineTitle({ render, className, ...props }) {
57
+ return useRender({
58
+ defaultTagName: "div",
59
+ render,
60
+ props: {
61
+ ...props,
62
+ "data-control-ui": "timeline",
63
+ "data-control-family": "timeline",
64
+ "data-slot": "title",
65
+ className: cn("min-w-0", className)
66
+ }
59
67
  });
60
68
  }
61
69
  function TimelineDescription({ className, ...props }) {
@@ -1,7 +1,7 @@
1
1
  import { ButtonProps } from "./button.js";
2
2
  import { PopupKnobStyle } from "../knob-contracts/popup-knobs.js";
3
3
  import { CSSProperties, ReactNode } from "react";
4
- import { Toast } from "@base-ui/react/toast";
4
+ import { Toast, ToastManagerAddOptions, ToastManagerPromiseOptions } from "@base-ui/react/toast";
5
5
  //#region src/ui/toast.d.ts
6
6
  export type ToasterProps = {
7
7
  className?: string;
@@ -11,18 +11,24 @@ export type ToasterProps = {
11
11
  indicatorStyle?: CSSProperties & PopupKnobStyle;
12
12
  actionStyle?: ButtonProps["style"];
13
13
  closeStyle?: ButtonProps["style"];
14
+ closeLabel?: string;
15
+ successLabel?: string;
16
+ errorLabel?: string;
17
+ warningLabel?: string;
18
+ infoLabel?: string;
14
19
  };
15
20
  export declare const toastManager: import("@base-ui/react").ToastManager<any>;
16
- type ToastOptions = Omit<Parameters<typeof toastManager.add>[0], "title">;
17
- export declare const toast: ((title: ReactNode, options?: ToastOptions) => string) & {
21
+ type ToastOptions = Omit<ToastManagerAddOptions<object>, "title">;
22
+ declare function show(title: ReactNode, options?: ToastOptions): string;
23
+ export declare const toast: typeof show & {
18
24
  success: (title: ReactNode, options?: ToastOptions) => string;
19
25
  error: (title: ReactNode, options?: ToastOptions) => string;
20
26
  warning: (title: ReactNode, options?: ToastOptions) => string;
21
27
  info: (title: ReactNode, options?: ToastOptions) => string;
22
28
  message: (title: ReactNode, options?: ToastOptions) => string;
23
- promise: (...args: Parameters<typeof toastManager.promise>) => Promise<unknown>;
29
+ promise: <Value>(promise: Promise<Value>, options: ToastManagerPromiseOptions<Value, object>) => Promise<Value>;
24
30
  dismiss: (id?: string) => void;
25
31
  };
26
32
  export declare const useToast: typeof Toast.useToastManager;
27
- export declare function Toaster({ className, timeout, limit, rootStyle, indicatorStyle, actionStyle, closeStyle }: ToasterProps): import("react").JSX.Element;
33
+ export declare function Toaster({ className, timeout, limit, rootStyle, indicatorStyle, actionStyle, closeStyle, closeLabel, successLabel, errorLabel, warningLabel, infoLabel }: ToasterProps): import("react").JSX.Element;
28
34
  //#endregion
package/dist/ui/toast.js CHANGED
@@ -3,36 +3,104 @@ import { controlEffectsAttribute } from "../skin.js";
3
3
  import { cn } from "../lib/cn.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";
8
+ import { CircleCheckIcon, CircleXIcon, InfoIcon, TriangleAlertIcon } from "lucide-react";
7
9
  import { Toast } from "@base-ui/react/toast";
8
10
  //#region src/ui/toast.tsx
9
11
  const toastManager = Toast.createToastManager();
10
- function withType(type) {
11
- return (title, options) => toastManager.add({
12
+ const errorDefaults = {
13
+ timeout: 0,
14
+ priority: "high"
15
+ };
16
+ function persistenceDefaults(options) {
17
+ if (options.type === "error") return errorDefaults;
18
+ return options.actionProps ? { timeout: 0 } : void 0;
19
+ }
20
+ function show(title, options = {}) {
21
+ return toastManager.add({
12
22
  title,
23
+ ...persistenceDefaults(options),
24
+ ...options
25
+ });
26
+ }
27
+ function withType(type) {
28
+ return (title, options) => show(title, {
13
29
  type,
14
30
  ...options
15
31
  });
16
32
  }
17
- const toast = Object.assign((title, options) => toastManager.add({
18
- title,
19
- ...options
20
- }), {
33
+ function persistentError(update) {
34
+ return typeof update === "string" ? {
35
+ ...errorDefaults,
36
+ description: update
37
+ } : {
38
+ ...errorDefaults,
39
+ ...update
40
+ };
41
+ }
42
+ const toast = Object.assign(show, {
21
43
  success: withType("success"),
22
44
  error: withType("error"),
23
45
  warning: withType("warning"),
24
46
  info: withType("info"),
25
- message: (title, options) => toastManager.add({
26
- title,
27
- ...options
47
+ message: (title, options) => show(title, options),
48
+ promise: (promise, options) => toastManager.promise(promise, {
49
+ ...options,
50
+ error: (reason) => persistentError(typeof options.error === "function" ? options.error(reason) : options.error)
28
51
  }),
29
- promise: (...args) => toastManager.promise(...args),
30
52
  dismiss: (id) => toastManager.close(id)
31
53
  });
54
+ const statusIcons = {
55
+ success: CircleCheckIcon,
56
+ error: CircleXIcon,
57
+ warning: TriangleAlertIcon,
58
+ info: InfoIcon
59
+ };
60
+ function isToastStatus(type) {
61
+ return type !== void 0 && Object.hasOwn(statusIcons, type);
62
+ }
32
63
  const useToast = Toast.useToastManager;
33
- function ToastList({ rootStyle, indicatorStyle, actionStyle, closeStyle }) {
64
+ function ToastIndicator({ status, style }) {
65
+ if (!status) return null;
66
+ const StatusIcon = statusIcons[status];
67
+ return /* @__PURE__ */ jsx("span", {
68
+ "aria-hidden": "true",
69
+ "data-control-ui": "toast",
70
+ "data-control-family": "popup",
71
+ "data-popup-kind": "toast",
72
+ "data-slot": "indicator",
73
+ style,
74
+ className: "shrink-0",
75
+ children: /* @__PURE__ */ jsx(StatusIcon, { className: "size-4" })
76
+ });
77
+ }
78
+ function ToastText({ entry, statusPrefix }) {
79
+ return /* @__PURE__ */ jsxs("div", {
80
+ className: "flex min-w-0 flex-1 flex-col",
81
+ children: [entry.title ? /* @__PURE__ */ jsxs(Toast.Title, {
82
+ "data-control-ui": "toast",
83
+ "data-control-family": "popup",
84
+ "data-popup-kind": "toast",
85
+ "data-slot": "title",
86
+ children: [statusPrefix, entry.title]
87
+ }) : null, entry.description ? /* @__PURE__ */ jsxs(Toast.Description, {
88
+ "data-control-ui": "toast",
89
+ "data-control-family": "popup",
90
+ "data-popup-kind": "toast",
91
+ "data-slot": "description",
92
+ children: [entry.title ? null : statusPrefix, entry.description]
93
+ }) : null]
94
+ });
95
+ }
96
+ function ToastList({ rootStyle, indicatorStyle, actionStyle, closeStyle, closeLabel, statusLabels }) {
34
97
  const { toasts } = Toast.useToastManager();
35
98
  return toasts.map((entry) => {
99
+ const status = isToastStatus(entry.type) ? entry.type : void 0;
100
+ const statusPrefix = status ? /* @__PURE__ */ jsx("span", {
101
+ className: "sr-only",
102
+ children: `${statusLabels[status]}: `
103
+ }) : null;
36
104
  return /* @__PURE__ */ jsx(Toast.Root, {
37
105
  toast: entry,
38
106
  "data-control-ui": "toast",
@@ -43,7 +111,7 @@ function ToastList({ rootStyle, indicatorStyle, actionStyle, closeStyle }) {
43
111
  style: rootStyle,
44
112
  "data-slot": "root",
45
113
  "data-surface": "floating",
46
- className: cn("[--gap:0.75rem] [--peek:0.75rem] [--scale:calc(max(0,1-(var(--toast-index)*0.1)))] [--shrink:calc(1-var(--scale))] [--height:var(--toast-frontmost-height,var(--toast-height))] [--offset-y:calc(var(--toast-offset-y)*-1+calc(var(--toast-index)*var(--gap)*-1)+var(--toast-swipe-movement-y))]", "absolute right-0 bottom-0 left-auto z-[calc(var(--z-toast)-var(--toast-index))] h-[var(--height)] w-full select-none data-[expanded]:h-[var(--toast-height)]", "after:absolute after:top-full after:left-0 after:h-[calc(var(--gap)+1px)] after:w-full after:content-['']"),
114
+ className: cn("[--gap:0.75rem] [--peek:0.75rem] [--scale:calc(max(0,1-(var(--toast-index)*0.1)))] [--shrink:calc(1-var(--scale))] [--height:var(--toast-frontmost-height,var(--toast-height))] [--offset-y:calc(var(--toast-offset-y)*-1+calc(var(--toast-index)*var(--gap)*-1)+var(--toast-swipe-movement-y))]", "absolute end-0 bottom-0 z-[calc(var(--z-toast)-var(--toast-index))] h-[var(--height)] w-full select-none data-[expanded]:h-[var(--toast-height)]", "after:absolute after:top-full after:start-0 after:h-[calc(var(--gap)+1px)] after:w-full after:content-['']"),
47
115
  children: /* @__PURE__ */ jsxs(Toast.Content, {
48
116
  "data-control-ui": "toast",
49
117
  "data-control-family": "popup",
@@ -51,28 +119,13 @@ function ToastList({ rootStyle, indicatorStyle, actionStyle, closeStyle }) {
51
119
  "data-slot": "content",
52
120
  className: "flex items-start",
53
121
  children: [
54
- entry.type && entry.type !== "message" ? /* @__PURE__ */ jsx("span", {
55
- "aria-hidden": "true",
56
- "data-control-ui": "toast",
57
- "data-control-family": "popup",
58
- "data-popup-kind": "toast",
59
- "data-slot": "indicator",
60
- style: indicatorStyle,
61
- className: "shrink-0"
62
- }) : null,
63
- /* @__PURE__ */ jsxs("div", {
64
- className: "flex min-w-0 flex-1 flex-col",
65
- children: [entry.title ? /* @__PURE__ */ jsx(Toast.Title, {
66
- "data-control-ui": "toast",
67
- "data-control-family": "popup",
68
- "data-popup-kind": "toast",
69
- "data-slot": "title"
70
- }) : null, entry.description ? /* @__PURE__ */ jsx(Toast.Description, {
71
- "data-control-ui": "toast",
72
- "data-control-family": "popup",
73
- "data-popup-kind": "toast",
74
- "data-slot": "description"
75
- }) : null]
122
+ /* @__PURE__ */ jsx(ToastIndicator, {
123
+ status,
124
+ style: indicatorStyle
125
+ }),
126
+ /* @__PURE__ */ jsx(ToastText, {
127
+ entry,
128
+ statusPrefix
76
129
  }),
77
130
  entry.actionProps ? /* @__PURE__ */ jsx(Toast.Action, {
78
131
  style: actionStyle,
@@ -86,25 +139,11 @@ function ToastList({ rootStyle, indicatorStyle, actionStyle, closeStyle }) {
86
139
  }) : null,
87
140
  /* @__PURE__ */ jsx(Toast.Close, {
88
141
  style: closeStyle,
89
- "aria-label": "Close",
90
- render: (renderProps) => /* @__PURE__ */ jsx(Button, {
142
+ render: (renderProps) => /* @__PURE__ */ jsx(PopupCloseButton, {
91
143
  ...renderProps,
92
144
  "data-popup-kind": "toast",
93
- "data-popup-part": "close",
94
- variant: "quiet",
95
- size: "xs",
96
- iconOnly: true
97
- }),
98
- children: /* @__PURE__ */ jsx("svg", {
99
- viewBox: "0 0 16 16",
100
- "aria-hidden": "true",
101
- fill: "none",
102
- children: /* @__PURE__ */ jsx("path", {
103
- d: "M4 4 12 12M12 4 4 12",
104
- stroke: "currentColor",
105
- strokeWidth: "1.4",
106
- strokeLinecap: "round"
107
- })
145
+ label: closeLabel,
146
+ variant: "quiet"
108
147
  })
109
148
  })
110
149
  ]
@@ -112,7 +151,7 @@ function ToastList({ rootStyle, indicatorStyle, actionStyle, closeStyle }) {
112
151
  }, entry.id);
113
152
  });
114
153
  }
115
- function Toaster({ className, timeout, limit, rootStyle, indicatorStyle, actionStyle, closeStyle }) {
154
+ function Toaster({ className, timeout, limit, rootStyle, indicatorStyle, actionStyle, closeStyle, closeLabel = "Dismiss notification", successLabel = "Success", errorLabel = "Error", warningLabel = "Warning", infoLabel = "Info" }) {
116
155
  const skin = useSkin();
117
156
  return /* @__PURE__ */ jsx(Toast.Provider, {
118
157
  toastManager,
@@ -125,12 +164,19 @@ function Toaster({ className, timeout, limit, rootStyle, indicatorStyle, actionS
125
164
  "data-slot": "viewport",
126
165
  "data-skin": skin.id,
127
166
  "data-effects": controlEffectsAttribute(skin.effects),
128
- className: cn("fixed right-4 bottom-4 z-(--z-toast) mx-auto w-[calc(100vw-2rem)] sm:right-6 sm:bottom-6 sm:w-[22.5rem]", className),
167
+ className: cn("fixed end-4 bottom-4 z-(--z-toast) mx-auto w-[calc(100vw-2rem)] sm:end-6 sm:bottom-6 sm:w-[22.5rem]", className),
129
168
  children: /* @__PURE__ */ jsx(ToastList, {
130
169
  rootStyle,
131
170
  indicatorStyle,
132
171
  actionStyle,
133
- closeStyle
172
+ closeStyle,
173
+ closeLabel,
174
+ statusLabels: {
175
+ success: successLabel,
176
+ error: errorLabel,
177
+ warning: warningLabel,
178
+ info: infoLabel
179
+ }
134
180
  })
135
181
  }) })
136
182
  });
@@ -15,6 +15,7 @@ export type ToolbarButtonProps = Omit<ComponentProps<"button">, "style"> & {
15
15
  };
16
16
  export type ToolbarLinkProps = Omit<ComponentProps<"a">, "style"> & {
17
17
  variant?: ToolbarLinkVariant;
18
+ active?: boolean;
18
19
  style?: CSSProperties & ToolbarKnobStyle;
19
20
  };
20
21
  export type ToolbarGroupProps = ComponentProps<"div"> & {
@@ -31,7 +32,7 @@ export declare function Toolbar({ orientation, variant, className, children, ...
31
32
  type RefinedToolbarButtonProps = ToolbarButtonProps & Pick<ComponentProps<typeof Toolbar$1.Button>, "render">;
32
33
  export declare function ToolbarButton({ iconOnly, className, ...props }: RefinedToolbarButtonProps): import("react").JSX.Element;
33
34
  type RefinedToolbarLinkProps = ToolbarLinkProps & Pick<ComponentProps<typeof Toolbar$1.Link>, "render">;
34
- export declare function ToolbarLink({ variant, className, ...props }: RefinedToolbarLinkProps): import("react").JSX.Element;
35
+ export declare function ToolbarLink({ variant, active, className, ...props }: RefinedToolbarLinkProps): import("react").JSX.Element;
35
36
  export declare function ToolbarGroup({ className, ...props }: ToolbarGroupProps): import("react").JSX.Element;
36
37
  export declare function ToolbarSeparator({ orientation, className, ...props }: ToolbarSeparatorProps): import("react").JSX.Element;
37
38
  type RefinedToolbarInputProps = ToolbarInputProps & Pick<ComponentProps<typeof Toolbar$1.Input>, "render">;
@@ -37,7 +37,7 @@ function ToolbarButton({ iconOnly = false, className, ...props }) {
37
37
  ...props
38
38
  });
39
39
  }
40
- function ToolbarLink({ variant = "default", className, ...props }) {
40
+ function ToolbarLink({ variant = "default", active = false, className, ...props }) {
41
41
  return /* @__PURE__ */ jsx(Toolbar$1.Link, {
42
42
  "data-control-ui": "toolbar",
43
43
  "data-control-family": "toolbar",
@@ -45,6 +45,8 @@ function ToolbarLink({ variant = "default", className, ...props }) {
45
45
  "data-control": "true",
46
46
  "data-size": "sm",
47
47
  "data-variant": variant,
48
+ "data-active": active || void 0,
49
+ "aria-current": active ? "page" : void 0,
48
50
  className: cn("inline-flex shrink-0 items-center justify-center [&_svg]:block [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0", variant === "track" && "relative z-[2]", className),
49
51
  ...props
50
52
  });
@@ -2,6 +2,7 @@
2
2
  import { controlEffectsAttribute } from "../skin.js";
3
3
  import { cn } from "../lib/cn.js";
4
4
  import { useSkin } from "../skin-provider.js";
5
+ import { PopupArrowShape } from "../popup-parts.js";
5
6
  import { jsx, jsxs } from "react/jsx-runtime";
6
7
  import { Tooltip as Tooltip$1 } from "@base-ui/react/tooltip";
7
8
  //#region src/ui/tooltip.tsx
@@ -64,29 +65,11 @@ function TooltipContent({ className, children, side = "top", sideOffset = 8, ali
64
65
  "data-control-family": "popup",
65
66
  "data-popup-kind": "tooltip",
66
67
  "data-slot": "arrow",
67
- className: cn("flex", "data-[side=top]:-bottom-[8px]", "data-[side=bottom]:-top-[8px]", "data-[side=left]:-right-[10px]", "data-[side=right]:-left-[10px]"),
68
- children: /* @__PURE__ */ jsx(TooltipArrowSvg, {})
68
+ className: "flex",
69
+ children: /* @__PURE__ */ jsx(PopupArrowShape, {})
69
70
  }) : null]
70
71
  })
71
72
  }) });
72
73
  }
73
- function TooltipArrowSvg() {
74
- return /* @__PURE__ */ jsx("svg", {
75
- "aria-hidden": "true",
76
- focusable: "false",
77
- width: "12",
78
- height: "8",
79
- viewBox: "0 0 12 8",
80
- fill: "none",
81
- overflow: "visible",
82
- children: /* @__PURE__ */ jsx("path", {
83
- "data-control-ui": "tooltip",
84
- "data-popup-kind": "tooltip",
85
- "data-control-family": "popup",
86
- "data-slot": "arrow-shape",
87
- d: "M0 7L4 2Q6 0 8 2L12 7L12 8L0 8Z"
88
- })
89
- });
90
- }
91
74
  //#endregion
92
75
  export { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger };