@tangle-network/ui 11.11.8 → 11.13.0

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 (279) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/dist/_virtual/_rolldown/runtime.js +13 -0
  3. package/dist/auth/auth.d.ts +53 -0
  4. package/dist/{auth-DOETfnd9.js → auth/auth.js} +7 -37
  5. package/dist/auth/login-layout.d.ts +20 -0
  6. package/dist/auth/login-layout.js +36 -0
  7. package/dist/auth.d.ts +2 -1
  8. package/dist/auth.js +2 -1
  9. package/dist/chat/agent-timeline.d.ts +83 -0
  10. package/dist/chat/agent-timeline.js +236 -0
  11. package/dist/chat/chat-container.d.ts +51 -0
  12. package/dist/chat/chat-container.js +309 -0
  13. package/dist/chat/chat-message.d.ts +22 -0
  14. package/dist/chat/chat-message.js +38 -0
  15. package/dist/chat/message-list.d.ts +32 -0
  16. package/dist/chat/message-list.js +37 -0
  17. package/dist/chat/thinking-indicator.d.ts +6 -0
  18. package/dist/chat/thinking-indicator.js +38 -0
  19. package/dist/chat/user-message.d.ts +21 -0
  20. package/dist/chat/user-message.js +42 -0
  21. package/dist/chat.d.ts +6 -1
  22. package/dist/chat.js +6 -1
  23. package/dist/editor/document-editor-pane.d.ts +37 -0
  24. package/dist/editor/document-editor-pane.js +199 -0
  25. package/dist/editor/editor-lazy.js +37 -0
  26. package/dist/editor/editor-loading.js +21 -0
  27. package/dist/editor/editor-peers.d.ts +6 -0
  28. package/dist/editor/editor-peers.js +155 -0
  29. package/dist/{document-editor-pane-DHM8DDhb.d.ts → editor/editor-provider.d.ts} +10 -47
  30. package/dist/editor/editor-provider.js +253 -0
  31. package/dist/editor/editor-toolbar.d.ts +11 -0
  32. package/dist/editor/editor-toolbar.js +106 -0
  33. package/dist/editor/markdown-conversion.js +23 -0
  34. package/dist/editor/markdown-document-editor.js +103 -0
  35. package/dist/editor/tiptap-editor.d.ts +45 -0
  36. package/dist/editor/tiptap-editor.js +271 -0
  37. package/dist/editor/use-editor.d.ts +67 -0
  38. package/dist/editor/use-editor.js +158 -0
  39. package/dist/editor.d.ts +6 -119
  40. package/dist/editor.js +5 -1
  41. package/dist/files/file-artifact-pane.d.ts +47 -0
  42. package/dist/files/file-artifact-pane.js +114 -0
  43. package/dist/files/file-format.d.ts +51 -0
  44. package/dist/{file-format-BgXbr-Ib.js → files/file-format.js} +1 -1
  45. package/dist/files/file-preview.d.ts +27 -0
  46. package/dist/files/file-preview.js +359 -0
  47. package/dist/files/file-tabs.d.ts +19 -0
  48. package/dist/files/file-tabs.js +48 -0
  49. package/dist/files/file-tree.d.ts +31 -0
  50. package/dist/files/file-tree.js +135 -0
  51. package/dist/files/rich-file-tree.d.ts +62 -0
  52. package/dist/files/rich-file-tree.js +122 -0
  53. package/dist/files.d.ts +6 -1
  54. package/dist/files.js +6 -2
  55. package/dist/hooks/use-auth.d.ts +40 -0
  56. package/dist/hooks/use-auth.js +91 -0
  57. package/dist/hooks/use-auto-scroll.d.ts +11 -0
  58. package/dist/hooks/use-auto-scroll.js +48 -0
  59. package/dist/hooks/use-dropdown-menu.d.ts +12 -0
  60. package/dist/hooks/use-dropdown-menu.js +31 -0
  61. package/dist/hooks/use-live-time.d.ts +7 -0
  62. package/dist/hooks/use-live-time.js +22 -0
  63. package/dist/hooks/use-realtime-session.d.ts +32 -0
  64. package/dist/hooks/use-realtime-session.js +235 -0
  65. package/dist/hooks/use-run-collapse-state.d.ts +13 -0
  66. package/dist/hooks/use-run-collapse-state.js +24 -0
  67. package/dist/hooks/use-run-groups.d.ts +11 -0
  68. package/dist/hooks/use-run-groups.js +85 -0
  69. package/dist/hooks/use-sdk-session.d.ts +59 -0
  70. package/dist/hooks/use-sdk-session.js +322 -0
  71. package/dist/hooks/use-sse-stream.d.ts +124 -0
  72. package/dist/hooks/use-sse-stream.js +229 -0
  73. package/dist/hooks/use-tool-call-stream.d.ts +23 -0
  74. package/dist/hooks/use-tool-call-stream.js +75 -0
  75. package/dist/hooks.d.ts +11 -49
  76. package/dist/hooks.js +10 -110
  77. package/dist/index.d.ts +99 -25
  78. package/dist/index.js +86 -36
  79. package/dist/lib/focus.d.ts +55 -0
  80. package/dist/{focus-BcE_SHqz.js → lib/focus.js} +1 -1
  81. package/dist/lib/utils.d.ts +4 -0
  82. package/dist/{utils-C_uf36nf.js → lib/utils.js} +1 -1
  83. package/dist/{code-block-B9miUPht.d.ts → markdown/code-block.d.ts} +5 -6
  84. package/dist/{code-block-B36KVUSN.js → markdown/code-block.js} +22 -47
  85. package/dist/{markdown-C0atSabr.d.ts → markdown/markdown.d.ts} +4 -5
  86. package/dist/{markdown-Db08KAYF.js → markdown/markdown.js} +3 -3
  87. package/dist/markdown.d.ts +2 -2
  88. package/dist/markdown.js +2 -2
  89. package/dist/{openui-artifact-renderer-fkBQaoLO.d.ts → openui/openui-artifact-renderer.d.ts} +20 -21
  90. package/dist/{openui-artifact-renderer-DG_i2lOR.js → openui/openui-artifact-renderer.js} +9 -7
  91. package/dist/{schema-BpW9rSSG.js → openui/schema-compiled.js} +2 -354
  92. package/dist/{schema-DAstk-J4.d.ts → openui/schema-data.d.ts} +3 -24
  93. package/dist/openui/schema-data.js +206 -0
  94. package/dist/openui-schema.d.ts +22 -3
  95. package/dist/openui-schema.js +138 -1
  96. package/dist/openui.d.ts +3 -2
  97. package/dist/openui.js +3 -2
  98. package/dist/{artifact-pane-BL_DFWNl.d.ts → primitives/artifact-pane.d.ts} +3 -4
  99. package/dist/{artifact-pane-DMXT9a8U.js → primitives/artifact-pane.js} +2 -2
  100. package/dist/primitives/avatar.d.ts +8 -0
  101. package/dist/primitives/avatar.js +25 -0
  102. package/dist/primitives/badge.d.ts +22 -0
  103. package/dist/primitives/badge.js +47 -0
  104. package/dist/{button-yoIv77e2.d.ts → primitives/button.d.ts} +2 -2
  105. package/dist/primitives/button.js +113 -0
  106. package/dist/primitives/card.d.ts +18 -0
  107. package/dist/primitives/card.js +52 -0
  108. package/dist/primitives/code-block.d.ts +6 -0
  109. package/dist/primitives/code-block.js +13 -0
  110. package/dist/primitives/dialog.d.ts +23 -0
  111. package/dist/primitives/dialog.js +59 -0
  112. package/dist/primitives/drop-zone.d.ts +23 -0
  113. package/dist/primitives/drop-zone.js +104 -0
  114. package/dist/primitives/dropdown-menu.d.ts +29 -0
  115. package/dist/{dropdown-menu-BpcLa5vF.js → primitives/dropdown-menu.js} +2 -23
  116. package/dist/primitives/empty-state.d.ts +11 -0
  117. package/dist/primitives/empty-state.js +32 -0
  118. package/dist/primitives/heading.d.ts +23 -0
  119. package/dist/primitives/heading.js +38 -0
  120. package/dist/primitives/input.d.ts +23 -0
  121. package/dist/primitives/input.js +110 -0
  122. package/dist/primitives/label.d.ts +6 -0
  123. package/dist/primitives/label.js +16 -0
  124. package/dist/primitives/metric-strip.d.ts +48 -0
  125. package/dist/primitives/metric-strip.js +52 -0
  126. package/dist/primitives/page-header.d.ts +25 -0
  127. package/dist/primitives/page-header.js +47 -0
  128. package/dist/primitives/page-shell.d.ts +14 -0
  129. package/dist/primitives/page-shell.js +17 -0
  130. package/dist/primitives/progress.d.ts +9 -0
  131. package/dist/primitives/progress.js +29 -0
  132. package/dist/primitives/segmented-control.d.ts +40 -0
  133. package/dist/primitives/segmented-control.js +57 -0
  134. package/dist/primitives/select.d.ts +15 -0
  135. package/dist/primitives/select.js +74 -0
  136. package/dist/primitives/sidebar-drop-zone.d.ts +21 -0
  137. package/dist/primitives/sidebar-drop-zone.js +88 -0
  138. package/dist/primitives/skeleton.d.ts +10 -0
  139. package/dist/primitives/skeleton.js +50 -0
  140. package/dist/primitives/stat-card.d.ts +16 -0
  141. package/dist/primitives/stat-card.js +60 -0
  142. package/dist/primitives/status-pill.d.ts +44 -0
  143. package/dist/primitives/status-pill.js +119 -0
  144. package/dist/primitives/switch.d.ts +6 -0
  145. package/dist/primitives/switch.js +16 -0
  146. package/dist/primitives/table.d.ts +22 -0
  147. package/dist/primitives/table.js +63 -0
  148. package/dist/primitives/tabs.d.ts +13 -0
  149. package/dist/{tabs-BVHR6NkO.js → primitives/tabs.js} +3 -3
  150. package/dist/primitives/terminal-display.d.ts +25 -0
  151. package/dist/primitives/terminal-display.js +109 -0
  152. package/dist/primitives/text-shimmer.d.ts +16 -0
  153. package/dist/{text-shimmer-BUUo6I-g.js → primitives/text-shimmer.js} +2 -2
  154. package/dist/primitives/theme-toggle.d.ts +11 -0
  155. package/dist/primitives/theme-toggle.js +154 -0
  156. package/dist/primitives/toast.d.ts +29 -0
  157. package/dist/primitives/toast.js +142 -0
  158. package/dist/primitives/toolbar.d.ts +55 -0
  159. package/dist/primitives/toolbar.js +37 -0
  160. package/dist/primitives/upload-progress.d.ts +23 -0
  161. package/dist/primitives/upload-progress.js +72 -0
  162. package/dist/primitives.d.ts +35 -5
  163. package/dist/primitives.js +35 -9
  164. package/dist/{index-COgqsFAQ.d.ts → redaction/redacted-document.d.ts} +6 -7
  165. package/dist/{redaction-CGGB2ENG.js → redaction/redacted-document.js} +2 -2
  166. package/dist/redaction.d.ts +1 -1
  167. package/dist/redaction.js +1 -1
  168. package/dist/run/expandable-content.js +41 -0
  169. package/dist/run/expanded-tool-detail.d.ts +12 -0
  170. package/dist/run/expanded-tool-detail.js +163 -0
  171. package/dist/run/inline-thinking-item.d.ts +11 -0
  172. package/dist/run/inline-thinking-item.js +60 -0
  173. package/dist/run/inline-tool-item.d.ts +25 -0
  174. package/dist/run/inline-tool-item.js +63 -0
  175. package/dist/run/run-group.d.ts +26 -0
  176. package/dist/{run-group-BWGeesgs.js → run/run-group.js} +9 -60
  177. package/dist/run/run-item-primitives.d.ts +5 -0
  178. package/dist/{run-ZsIKPA6J.js → run/run-item-primitives.js} +2 -2
  179. package/dist/run/run-row-shell.d.ts +53 -0
  180. package/dist/run/run-row-shell.js +114 -0
  181. package/dist/{tool-call-feed-BeB1_4pX.d.ts → run/tool-call-feed.d.ts} +7 -12
  182. package/dist/{tool-call-feed-BpmMLpPX.js → run/tool-call-feed.js} +4 -4
  183. package/dist/run/tool-call-step.d.ts +5 -0
  184. package/dist/run/tool-call-step.js +82 -0
  185. package/dist/run.d.ts +8 -2
  186. package/dist/run.js +7 -4
  187. package/dist/sdk-hooks.d.ts +8 -1
  188. package/dist/sdk-hooks.js +8 -2
  189. package/dist/stores/active-sessions-store.d.ts +83 -0
  190. package/dist/{active-sessions-store-Gt1R0rFG.js → stores/active-sessions-store.js} +1 -1
  191. package/dist/stores/chat-store.d.ts +14 -0
  192. package/dist/stores/chat-store.js +33 -0
  193. package/dist/stores.d.ts +3 -16
  194. package/dist/stores.js +2 -33
  195. package/dist/tool-previews/command-preview.d.ts +11 -0
  196. package/dist/tool-previews/command-preview.js +91 -0
  197. package/dist/tool-previews/diff-preview.d.ts +7 -0
  198. package/dist/tool-previews/diff-preview.js +76 -0
  199. package/dist/tool-previews/glob-results-preview.d.ts +7 -0
  200. package/dist/tool-previews/glob-results-preview.js +53 -0
  201. package/dist/tool-previews/grep-results-preview.d.ts +7 -0
  202. package/dist/tool-previews/grep-results-preview.js +99 -0
  203. package/dist/tool-previews/preview-primitives.js +58 -0
  204. package/dist/tool-previews/question-preview.d.ts +7 -0
  205. package/dist/tool-previews/question-preview.js +63 -0
  206. package/dist/tool-previews/web-search-preview.d.ts +7 -0
  207. package/dist/tool-previews/web-search-preview.js +78 -0
  208. package/dist/tool-previews/write-file-preview.d.ts +11 -0
  209. package/dist/tool-previews/write-file-preview.js +52 -0
  210. package/dist/tool-previews.d.ts +7 -1
  211. package/dist/tool-previews.js +7 -1
  212. package/dist/{branding-26d5ARIr.d.ts → types/branding.d.ts} +2 -3
  213. package/dist/{message-vhUI0c5G.d.ts → types/message.d.ts} +2 -3
  214. package/dist/{parts-5mhy9yJ3.d.ts → types/parts.d.ts} +8 -9
  215. package/dist/{run-OyWmIDqu.d.ts → types/run.d.ts} +9 -10
  216. package/dist/{tool-display-DgmL5rIU.d.ts → types/tool-display.d.ts} +5 -6
  217. package/dist/types.d.ts +5 -5
  218. package/dist/utils/copy-text.d.ts +7 -0
  219. package/dist/{utils-Bl_CZ0Qp.js → utils/copy-text.js} +1 -11
  220. package/dist/utils/format.d.ts +22 -0
  221. package/dist/{format-DfcLWqMa.js → utils/format.js} +1 -1
  222. package/dist/utils/time-ago.d.ts +3 -0
  223. package/dist/utils/time-ago.js +11 -0
  224. package/dist/utils/tool-display.d.ts +16 -0
  225. package/dist/{tool-display-BAuAVa43.js → utils/tool-display.js} +1 -1
  226. package/dist/utils.d.ts +6 -1
  227. package/dist/utils.js +6 -5
  228. package/package.json +2 -2
  229. package/src/editor/document-editor-pane.tsx +4 -1
  230. package/src/files/file-artifact-pane.test.tsx +23 -0
  231. package/src/files/file-artifact-pane.tsx +3 -0
  232. package/src/files/rich-file-tree.stories.tsx +1 -1
  233. package/src/files/rich-file-tree.tsx +12 -9
  234. package/src/markdown/code-block.test.tsx +46 -2
  235. package/src/markdown/code-block.tsx +23 -60
  236. package/src/markdown/markdown.test.tsx +3 -2
  237. package/src/primitives/button.stories.tsx +37 -1
  238. package/src/primitives/button.test.tsx +230 -0
  239. package/src/primitives/button.tsx +62 -14
  240. package/src/primitives/card-anatomy.stories.tsx +51 -0
  241. package/src/primitives/card.test.tsx +71 -0
  242. package/src/primitives/card.tsx +25 -13
  243. package/src/primitives/heading.stories.tsx +35 -0
  244. package/src/primitives/heading.test.tsx +56 -0
  245. package/src/primitives/heading.tsx +76 -0
  246. package/src/primitives/index.ts +8 -0
  247. package/src/primitives/input.stories.tsx +28 -0
  248. package/src/primitives/input.test.tsx +161 -0
  249. package/src/primitives/input.tsx +34 -28
  250. package/src/primitives/page-header.stories.tsx +51 -0
  251. package/src/primitives/page-header.test.tsx +48 -0
  252. package/src/primitives/page-header.tsx +35 -35
  253. package/src/primitives/page-shell.stories.tsx +89 -0
  254. package/src/primitives/page-shell.test.tsx +24 -0
  255. package/src/primitives/page-shell.tsx +26 -0
  256. package/src/primitives/table-wrapper.stories.tsx +54 -0
  257. package/src/primitives/table.test.tsx +72 -0
  258. package/src/primitives/table.tsx +33 -12
  259. package/src/primitives/theme-toggle.test.tsx +167 -0
  260. package/src/primitives/theme-toggle.tsx +111 -39
  261. package/dist/active-sessions-store-nl70ZnMC.d.ts +0 -84
  262. package/dist/button-C87nEe2R.js +0 -78
  263. package/dist/chat-DDvF2oGQ.js +0 -672
  264. package/dist/diff-preview-BcK3nRXb.js +0 -533
  265. package/dist/document-editor-pane-CsFbH2qo.js +0 -1279
  266. package/dist/files--Unn___t.js +0 -752
  267. package/dist/index-2UntyjBb.d.ts +0 -52
  268. package/dist/index-BgUHilZm.d.ts +0 -108
  269. package/dist/index-CPDET_s1.d.ts +0 -549
  270. package/dist/index-Cg6gYAqh.d.ts +0 -73
  271. package/dist/index-Cs7j8V7l.d.ts +0 -203
  272. package/dist/index-CyGSLGVF.d.ts +0 -234
  273. package/dist/index-DjKxO357.d.ts +0 -128
  274. package/dist/primitives-Bx59fT-U.js +0 -1239
  275. package/dist/table-Bss73DhB.js +0 -146
  276. package/dist/tool-call-step-DNebqhmX.js +0 -434
  277. package/dist/use-auto-scroll-C5Pjeqon.js +0 -153
  278. package/dist/use-sse-stream-DjqRuDft.js +0 -884
  279. package/dist/use-sse-stream-Dm6R5YWz.d.ts +0 -282
@@ -0,0 +1,55 @@
1
+ //#region src/lib/focus.d.ts
2
+ /**
3
+ * The focus treatment every control shares, in two shapes over one palette
4
+ * (`--focus-border`, `--focus-halo` and `--border-strong` from
5
+ * `@tangle-network/brand`'s tokens.css).
6
+ *
7
+ * A FIELD — input, textarea, select trigger, composer — shows focus on its own
8
+ * border: the hairline shifts to `--focus-border` and a 3px `--focus-halo` ring
9
+ * spreads outside it. It keys off `:focus`, because a caret in a field needs the
10
+ * cue whether the field was clicked or tabbed into.
11
+ *
12
+ * A CONTROL — button, tab, switch, link, card — has no border to shift, so it
13
+ * draws a 1px `--focus-border` outline with the same 3px halo beyond it. It keys
14
+ * off `:focus-visible`, so a mouse click leaves no ring.
15
+ *
16
+ * The halo is a Tailwind ring, which renders as box-shadow: it follows
17
+ * border-radius and never moves layout, and a consumer removes it with
18
+ * `focus:ring-0` / `focus-visible:ring-0`, which tailwind-merge resolves against
19
+ * these classes. The control's line is an outline so that forced-colors mode,
20
+ * which drops box-shadows, still paints it. A field has its border for that, so
21
+ * it hides the outline with `outline-hidden`, which stays transparent-but-present
22
+ * in forced-colors mode.
23
+ */
24
+ /**
25
+ * Resting hairline, neutral hover, and `:focus` border plus halo for a text
26
+ * field. The hover is a plain `hover:` class so a consumer's `hover:border-*`
27
+ * replaces it through tailwind-merge; the focus border outranks it because
28
+ * Tailwind emits `focus:` after `hover:`.
29
+ */
30
+ export declare const focusField = "border-border transition-[border-color,box-shadow] duration-150 ease-out hover:border-[var(--border-strong)] focus:outline-hidden focus:border-[var(--focus-border)] focus:ring-3 focus:ring-[var(--focus-halo)]";
31
+ /**
32
+ * The field treatment for a container that wraps a borderless field, such as a
33
+ * composer around a textarea and its buttons. It lights while a FIELD inside
34
+ * has focus: a text input, textarea, native select or contenteditable editor. A
35
+ * focused button, checkbox or button-type input inside the container shows only
36
+ * its own ring, so a click on the send button does not read as field focus and
37
+ * a tab to it does not stack two indicators. `:focus-within` cannot tell the
38
+ * two apart, so the rule keys off `:has()`; a consumer's `focus-within:*` class
39
+ * therefore does not replace it. To style that container's focus differently,
40
+ * compose your own classes instead of this helper. The field selector is
41
+ * written out in full because Tailwind reads class names statically.
42
+ * Base styles use its marker class to clear the inner editor fallback outline.
43
+ */
44
+ export declare const focusFieldWithin = "focus-field-within border-border transition-[border-color,box-shadow] duration-150 ease-out hover:border-[var(--border-strong)] has-[:is(textarea,select,[contenteditable]:not([contenteditable=false]),input:not([type=button],[type=submit],[type=reset],[type=image],[type=checkbox],[type=radio],[type=range],[type=color],[type=file])):focus]:border-[var(--focus-border)] has-[:is(textarea,select,[contenteditable]:not([contenteditable=false]),input:not([type=button],[type=submit],[type=reset],[type=image],[type=checkbox],[type=radio],[type=range],[type=color],[type=file])):focus]:ring-3 has-[:is(textarea,select,[contenteditable]:not([contenteditable=false]),input:not([type=button],[type=submit],[type=reset],[type=image],[type=checkbox],[type=radio],[type=range],[type=color],[type=file])):focus]:ring-[var(--focus-halo)]";
45
+ /** Error state for a field: a danger hairline and the same focus shape in danger. Compose after `focusField`. */
46
+ export declare const focusFieldInvalid = "border-[var(--surface-danger-border)] hover:border-[var(--surface-danger-border)] focus:border-[var(--focus-border-danger)] focus:ring-[var(--focus-halo-danger)]";
47
+ /** Keyboard-only focus for a control: a 1px focus line with the halo beyond it. */
48
+ export declare const focusRing = "focus-visible:outline-1 focus-visible:outline-[var(--focus-border)] focus-visible:ring-4 focus-visible:ring-[var(--focus-halo)] focus-visible:outline-offset-0";
49
+ /**
50
+ * `focusRing` drawn inside the box, for a control flush against a scroll
51
+ * container or its neighbours (a tab strip, a list row), where an outer ring
52
+ * would be clipped or would overlap them.
53
+ */
54
+ export declare const focusRingInset = "focus-visible:outline-1 focus-visible:outline-[var(--focus-border)] focus-visible:ring-4 focus-visible:ring-[var(--focus-halo)] focus-visible:-outline-offset-1 focus-visible:ring-inset";
55
+ //#endregion
@@ -54,4 +54,4 @@ const focusRing = `${focusRingBase} focus-visible:outline-offset-0`;
54
54
  */
55
55
  const focusRingInset = `${focusRingBase} focus-visible:-outline-offset-1 focus-visible:ring-inset`;
56
56
  //#endregion
57
- export { focusRingInset as a, focusRing as i, focusFieldInvalid as n, focusFieldWithin as r, focusField as t };
57
+ export { focusField, focusFieldInvalid, focusFieldWithin, focusRing, focusRingInset };
@@ -0,0 +1,4 @@
1
+ import { ClassValue } from "clsx";
2
+ //#region src/lib/utils.d.ts
3
+ export declare function cn(...inputs: ClassValue[]): string;
4
+ //#endregion
@@ -5,4 +5,4 @@ function cn(...inputs) {
5
5
  return twMerge(clsx(inputs));
6
6
  }
7
7
  //#endregion
8
- export { cn as t };
8
+ export { cn };
@@ -1,6 +1,6 @@
1
1
  import { HTMLAttributes, ReactNode } from "react";
2
2
  //#region src/markdown/code-block.d.ts
3
- interface CodeBlockProps extends HTMLAttributes<HTMLDivElement> {
3
+ export interface CodeBlockProps extends HTMLAttributes<HTMLDivElement> {
4
4
  code: string;
5
5
  language?: string;
6
6
  /**
@@ -10,14 +10,13 @@ interface CodeBlockProps extends HTMLAttributes<HTMLDivElement> {
10
10
  */
11
11
  label?: string;
12
12
  showLineNumbers?: boolean;
13
- /** Force light theme; defaults to dark */
13
+ /** Force light (true) or dark (false); omitted inherits the nearest theme. */
14
14
  light?: boolean;
15
15
  children?: ReactNode;
16
16
  }
17
- declare const CodeBlock: import("react").MemoExoticComponent<({ code, language, label, showLineNumbers, light: lightProp, className, children, ...props }: CodeBlockProps) => import("react").JSX.Element>;
17
+ export declare const CodeBlock: import("react").MemoExoticComponent<({ code, language, label, showLineNumbers, light, className, children, ...props }: CodeBlockProps) => import("react").JSX.Element>;
18
18
  /** Copy-to-clipboard button for use inside CodeBlock. */
19
- declare const CopyButton: import("react").MemoExoticComponent<({ text }: {
19
+ export declare const CopyButton: import("react").MemoExoticComponent<({ text }: {
20
20
  text: string;
21
21
  }) => import("react").JSX.Element>;
22
- //#endregion
23
- export { CodeBlockProps as n, CopyButton as r, CodeBlock as t };
22
+ //#endregion
@@ -1,22 +1,19 @@
1
- import { i as focusRing } from "./focus-BcE_SHqz.js";
2
- import { t as cn } from "./utils-C_uf36nf.js";
1
+ import { focusRing } from "../lib/focus.js";
2
+ import { cn } from "../lib/utils.js";
3
3
  import { memo, useCallback, useEffect, useRef, useState } from "react";
4
4
  import { jsx, jsxs } from "react/jsx-runtime";
5
5
  import { Check, Copy } from "lucide-react";
6
6
  import SyntaxHighlighter from "react-syntax-highlighter";
7
7
  //#region src/markdown/code-block.tsx
8
- function getSyntaxTheme() {
9
- const el = typeof document !== "undefined" ? document.documentElement : null;
10
- const v = (name, fallback) => el ? getComputedStyle(el).getPropertyValue(name).trim() || fallback : fallback;
11
- const comment = v("--syntax-comment", "#6B7094");
12
- const keyword = v("--syntax-keyword", "#A78FFF");
13
- const string = v("--syntax-string", "#10b981");
14
- const fn = v("--syntax-function", "#6D9FFF");
15
- const number = v("--syntax-number", "#FFB347");
16
- const meta = v("--syntax-meta", "#8263FF");
17
- const error = v("--syntax-error", "#FF4D6D");
18
- const variable = v("--syntax-variable", "#C4C0D8");
19
- const fg = v("--syntax-foreground", "#E8E6F6");
8
+ const syntaxTheme = (() => {
9
+ const comment = "var(--syntax-comment, currentColor)";
10
+ const keyword = "var(--syntax-keyword, currentColor)";
11
+ const string = "var(--syntax-string, currentColor)";
12
+ const fn = "var(--syntax-function, currentColor)";
13
+ const number = "var(--syntax-number, currentColor)";
14
+ const meta = "var(--syntax-meta, currentColor)";
15
+ const error = "var(--syntax-error, currentColor)";
16
+ const variable = "var(--syntax-variable, currentColor)";
20
17
  return {
21
18
  "hljs-comment": {
22
19
  color: comment,
@@ -63,45 +60,23 @@ function getSyntaxTheme() {
63
60
  "hljs-strong": { fontWeight: "bold" },
64
61
  "hljs-emphasis": { fontStyle: "italic" },
65
62
  "hljs": {
66
- color: fg,
63
+ color: "var(--syntax-foreground, currentColor)",
67
64
  background: "transparent"
68
65
  }
69
66
  };
70
- }
71
- const LIGHT_THEMES = /* @__PURE__ */ new Set(["vault", "dawn"]);
72
- function detectLightTheme() {
73
- return typeof document !== "undefined" && LIGHT_THEMES.has(document.documentElement.getAttribute("data-sandbox-theme") ?? "");
74
- }
75
- function useIsLightTheme() {
76
- const [isLight, setIsLight] = useState(detectLightTheme);
77
- useEffect(() => {
78
- if (typeof document === "undefined") return;
79
- setIsLight(detectLightTheme());
80
- const observer = new MutationObserver(() => setIsLight(detectLightTheme()));
81
- observer.observe(document.documentElement, {
82
- attributes: true,
83
- attributeFilter: ["data-sandbox-theme"]
84
- });
85
- return () => observer.disconnect();
86
- }, []);
87
- return isLight;
88
- }
89
- const CodeBlock = memo(({ code, language, label, showLineNumbers = false, light: lightProp, className, children, ...props }) => {
90
- const isLight = useIsLightTheme();
91
- const light = lightProp ?? isLight;
92
- const theme = getSyntaxTheme();
93
- const bg = "bg-card border-border";
94
- const headerBg = light ? "bg-muted/50 border-border" : "bg-background border-border";
95
- const langColor = "text-muted-foreground";
67
+ })();
68
+ const CodeBlock = memo(({ code, language, label, showLineNumbers = false, light, className, children, ...props }) => {
96
69
  const headerLabel = label ?? language;
70
+ const mode = light === void 0 ? {} : { "data-theme": light ? "light" : "dark" };
97
71
  return /* @__PURE__ */ jsxs("div", {
98
- className: cn("group relative overflow-hidden rounded-lg border font-mono", bg, className),
72
+ className: cn("group relative overflow-hidden rounded-lg border font-mono", "bg-card border-border", className),
99
73
  ...props,
74
+ ...mode,
100
75
  children: [
101
76
  headerLabel && /* @__PURE__ */ jsxs("div", {
102
- className: cn("flex items-center justify-between border-b px-3 py-1", headerBg),
77
+ className: "flex items-center justify-between border-b border-border px-3 py-1 bg-[var(--code-header-bg,hsl(var(--background)))]",
103
78
  children: [/* @__PURE__ */ jsx("span", {
104
- className: cn("text-[calc(var(--font-size-xs)-1px)] font-mono font-medium uppercase tracking-widest", langColor),
79
+ className: "text-[calc(var(--font-size-xs)-1px)] font-mono font-medium uppercase tracking-widest text-muted-foreground",
105
80
  children: headerLabel
106
81
  }), children]
107
82
  }),
@@ -111,10 +86,10 @@ const CodeBlock = memo(({ code, language, label, showLineNumbers = false, light:
111
86
  }),
112
87
  /* @__PURE__ */ jsx(SyntaxHighlighter, {
113
88
  language: language ?? "text",
114
- style: theme,
89
+ style: syntaxTheme,
115
90
  showLineNumbers,
116
91
  lineNumberStyle: {
117
- color: light ? "#8B92B8" : "#4A4D6A",
92
+ color: "var(--syntax-comment, currentColor)",
118
93
  minWidth: "2.5em",
119
94
  paddingRight: "1em"
120
95
  },
@@ -162,4 +137,4 @@ const CopyButton = memo(({ text }) => {
162
137
  });
163
138
  CopyButton.displayName = "CopyButton";
164
139
  //#endregion
165
- export { CopyButton as n, CodeBlock as t };
140
+ export { CodeBlock, CopyButton };
@@ -1,8 +1,8 @@
1
1
  import { UrlTransform } from "react-markdown";
2
2
  //#region src/markdown/markdown.d.ts
3
3
  /** Converts a raw Markdown fragment to the ID rehype-sanitize emits for its heading. */
4
- declare function getSanitizedMarkdownHeadingIdFromRawFragment(rawFragment: string): string;
5
- interface MarkdownProps {
4
+ export declare function getSanitizedMarkdownHeadingIdFromRawFragment(rawFragment: string): string;
5
+ export interface MarkdownProps {
6
6
  children: string;
7
7
  className?: string;
8
8
  /** Transform parsed link and image URLs while retaining protocol safety checks. */
@@ -12,6 +12,5 @@ interface MarkdownProps {
12
12
  * Renders Markdown content with GFM support, XSS sanitisation, and
13
13
  * custom code block rendering via our CodeBlock component.
14
14
  */
15
- declare const Markdown: import("react").MemoExoticComponent<({ children, className, urlTransform }: MarkdownProps) => import("react").JSX.Element>;
16
- //#endregion
17
- export { MarkdownProps as n, getSanitizedMarkdownHeadingIdFromRawFragment as r, Markdown as t };
15
+ export declare const Markdown: import("react").MemoExoticComponent<({ children, className, urlTransform }: MarkdownProps) => import("react").JSX.Element>;
16
+ //#endregion
@@ -1,5 +1,5 @@
1
- import { t as cn } from "./utils-C_uf36nf.js";
2
- import { n as CopyButton, t as CodeBlock } from "./code-block-B36KVUSN.js";
1
+ import { cn } from "../lib/utils.js";
2
+ import { CodeBlock, CopyButton } from "./code-block.js";
3
3
  import { memo } from "react";
4
4
  import { Fragment as Fragment$1, jsx } from "react/jsx-runtime";
5
5
  import ReactMarkdown, { defaultUrlTransform } from "react-markdown";
@@ -63,4 +63,4 @@ const Markdown = memo(({ children, className, urlTransform }) => {
63
63
  });
64
64
  Markdown.displayName = "Markdown";
65
65
  //#endregion
66
- export { getSanitizedMarkdownHeadingIdFromRawFragment as n, Markdown as t };
66
+ export { Markdown, getSanitizedMarkdownHeadingIdFromRawFragment };
@@ -1,3 +1,3 @@
1
- import { n as MarkdownProps, r as getSanitizedMarkdownHeadingIdFromRawFragment, t as Markdown } from "./markdown-C0atSabr.js";
2
- import { n as CodeBlockProps, r as CopyButton, t as CodeBlock } from "./code-block-B9miUPht.js";
1
+ import { Markdown, MarkdownProps, getSanitizedMarkdownHeadingIdFromRawFragment } from "./markdown/markdown.js";
2
+ import { CodeBlock, CodeBlockProps, CopyButton } from "./markdown/code-block.js";
3
3
  export { CodeBlock, type CodeBlockProps, CopyButton, Markdown, type MarkdownProps, getSanitizedMarkdownHeadingIdFromRawFragment };
package/dist/markdown.js CHANGED
@@ -1,3 +1,3 @@
1
- import { n as CopyButton, t as CodeBlock } from "./code-block-B36KVUSN.js";
2
- import { n as getSanitizedMarkdownHeadingIdFromRawFragment, t as Markdown } from "./markdown-Db08KAYF.js";
1
+ import { CodeBlock, CopyButton } from "./markdown/code-block.js";
2
+ import { Markdown, getSanitizedMarkdownHeadingIdFromRawFragment } from "./markdown/markdown.js";
3
3
  export { CodeBlock, CopyButton, Markdown, getSanitizedMarkdownHeadingIdFromRawFragment };
@@ -1,8 +1,8 @@
1
- import { n as MarkdownProps } from "./markdown-C0atSabr.js";
1
+ import { MarkdownProps } from "../markdown/markdown.js";
2
2
  import { ReactNode } from "react";
3
3
  //#region src/openui/openui-artifact-renderer.d.ts
4
- type OpenUIPrimitive = string | number | boolean | null | undefined;
5
- interface OpenUIAction {
4
+ export type OpenUIPrimitive = string | number | boolean | null | undefined;
5
+ export interface OpenUIAction {
6
6
  id: string;
7
7
  label: string;
8
8
  tone?: "default" | "secondary" | "outline" | "ghost" | "destructive";
@@ -12,32 +12,32 @@ interface OpenUIAction {
12
12
  interface OpenUIBaseNode {
13
13
  id?: string;
14
14
  }
15
- interface OpenUIHeadingNode extends OpenUIBaseNode {
15
+ export interface OpenUIHeadingNode extends OpenUIBaseNode {
16
16
  type: "heading";
17
17
  text: string;
18
18
  level?: 1 | 2 | 3 | 4;
19
19
  kicker?: string;
20
20
  meta?: string;
21
21
  }
22
- interface OpenUITextNode extends OpenUIBaseNode {
22
+ export interface OpenUITextNode extends OpenUIBaseNode {
23
23
  type: "text";
24
24
  text: string;
25
25
  tone?: "default" | "muted" | "success" | "warning" | "error";
26
26
  mono?: boolean;
27
27
  }
28
- interface OpenUIBadgeNode extends OpenUIBaseNode {
28
+ export interface OpenUIBadgeNode extends OpenUIBaseNode {
29
29
  type: "badge";
30
30
  label: string;
31
31
  tone?: "default" | "secondary" | "success" | "warning" | "error" | "info" | "sandbox";
32
32
  }
33
- interface OpenUIStatNode extends OpenUIBaseNode {
33
+ export interface OpenUIStatNode extends OpenUIBaseNode {
34
34
  type: "stat";
35
35
  label: string;
36
36
  value: string;
37
37
  change?: string;
38
38
  tone?: "default" | "success" | "warning" | "error" | "info";
39
39
  }
40
- interface OpenUIKeyValueNode extends OpenUIBaseNode {
40
+ export interface OpenUIKeyValueNode extends OpenUIBaseNode {
41
41
  type: "key_value";
42
42
  items: Array<{
43
43
  id?: string;
@@ -46,18 +46,18 @@ interface OpenUIKeyValueNode extends OpenUIBaseNode {
46
46
  tone?: "default" | "muted";
47
47
  }>;
48
48
  }
49
- interface OpenUICodeNode extends OpenUIBaseNode {
49
+ export interface OpenUICodeNode extends OpenUIBaseNode {
50
50
  type: "code";
51
51
  code: string;
52
52
  language?: string;
53
53
  title?: string;
54
54
  showLineNumbers?: boolean;
55
55
  }
56
- interface OpenUIMarkdownNode extends OpenUIBaseNode {
56
+ export interface OpenUIMarkdownNode extends OpenUIBaseNode {
57
57
  type: "markdown";
58
58
  content: string;
59
59
  }
60
- interface OpenUITableNode extends OpenUIBaseNode {
60
+ export interface OpenUITableNode extends OpenUIBaseNode {
61
61
  type: "table";
62
62
  columns: Array<{
63
63
  key: string;
@@ -67,15 +67,15 @@ interface OpenUITableNode extends OpenUIBaseNode {
67
67
  rows: Array<Record<string, ReactNode | OpenUIPrimitive>>;
68
68
  caption?: string;
69
69
  }
70
- interface OpenUIActionsNode extends OpenUIBaseNode {
70
+ export interface OpenUIActionsNode extends OpenUIBaseNode {
71
71
  type: "actions";
72
72
  actions: OpenUIAction[];
73
73
  }
74
- interface OpenUISeparatorNode extends OpenUIBaseNode {
74
+ export interface OpenUISeparatorNode extends OpenUIBaseNode {
75
75
  type: "separator";
76
76
  label?: string;
77
77
  }
78
- interface OpenUIStackNode extends OpenUIBaseNode {
78
+ export interface OpenUIStackNode extends OpenUIBaseNode {
79
79
  type: "stack";
80
80
  direction?: "row" | "column";
81
81
  gap?: "sm" | "md" | "lg";
@@ -83,13 +83,13 @@ interface OpenUIStackNode extends OpenUIBaseNode {
83
83
  wrap?: boolean;
84
84
  children: OpenUIComponentNode[];
85
85
  }
86
- interface OpenUIGridNode extends OpenUIBaseNode {
86
+ export interface OpenUIGridNode extends OpenUIBaseNode {
87
87
  type: "grid";
88
88
  columns?: 1 | 2 | 3 | 4;
89
89
  gap?: "sm" | "md" | "lg";
90
90
  children: OpenUIComponentNode[];
91
91
  }
92
- interface OpenUICardNode extends OpenUIBaseNode {
92
+ export interface OpenUICardNode extends OpenUIBaseNode {
93
93
  type: "card";
94
94
  title?: string;
95
95
  description?: string;
@@ -98,8 +98,8 @@ interface OpenUICardNode extends OpenUIBaseNode {
98
98
  actions?: OpenUIAction[];
99
99
  children?: OpenUIComponentNode[];
100
100
  }
101
- type OpenUIComponentNode = OpenUIActionsNode | OpenUIBadgeNode | OpenUICardNode | OpenUICodeNode | OpenUIGridNode | OpenUIHeadingNode | OpenUIKeyValueNode | OpenUIMarkdownNode | OpenUISeparatorNode | OpenUIStackNode | OpenUIStatNode | OpenUITableNode | OpenUITextNode;
102
- interface OpenUIArtifactRendererProps {
101
+ export type OpenUIComponentNode = OpenUIActionsNode | OpenUIBadgeNode | OpenUICardNode | OpenUICodeNode | OpenUIGridNode | OpenUIHeadingNode | OpenUIKeyValueNode | OpenUIMarkdownNode | OpenUISeparatorNode | OpenUIStackNode | OpenUIStatNode | OpenUITableNode | OpenUITextNode;
102
+ export interface OpenUIArtifactRendererProps {
103
103
  schema: OpenUIComponentNode | OpenUIComponentNode[];
104
104
  onAction?: (action: OpenUIAction) => void;
105
105
  className?: string;
@@ -111,6 +111,5 @@ interface OpenUIArtifactRendererProps {
111
111
  * extension surface for generated inspectors/results, not a replacement for
112
112
  * the sandbox shell.
113
113
  */
114
- declare function OpenUIArtifactRenderer({ schema, onAction, className, urlTransform }: OpenUIArtifactRendererProps): import("react").JSX.Element;
115
- //#endregion
116
- export { OpenUITableNode as _, OpenUIBadgeNode as a, OpenUIComponentNode as c, OpenUIKeyValueNode as d, OpenUIMarkdownNode as f, OpenUIStatNode as g, OpenUIStackNode as h, OpenUIArtifactRendererProps as i, OpenUIGridNode as l, OpenUISeparatorNode as m, OpenUIActionsNode as n, OpenUICardNode as o, OpenUIPrimitive as p, OpenUIArtifactRenderer as r, OpenUICodeNode as s, OpenUIAction as t, OpenUIHeadingNode as u, OpenUITextNode as v };
114
+ export declare function OpenUIArtifactRenderer({ schema, onAction, className, urlTransform }: OpenUIArtifactRendererProps): import("react").JSX.Element;
115
+ //#endregion
@@ -1,9 +1,11 @@
1
- import { t as findUnsupportedOpenUINode } from "./schema-BpW9rSSG.js";
2
- import { t as cn } from "./utils-C_uf36nf.js";
3
- import { t as Button } from "./button-C87nEe2R.js";
4
- import { c as TableRow, d as Card, f as CardContent, g as CardTitle, h as CardHeader, i as TableCell, l as Badge, n as TableBody, o as TableHead, p as CardDescription, s as TableHeader, t as Table } from "./table-Bss73DhB.js";
5
- import { t as CodeBlock } from "./code-block-B36KVUSN.js";
6
- import { t as Markdown } from "./markdown-Db08KAYF.js";
1
+ import { cn } from "../lib/utils.js";
2
+ import { Button } from "../primitives/button.js";
3
+ import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "../primitives/card.js";
4
+ import { Badge } from "../primitives/badge.js";
5
+ import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "../primitives/table.js";
6
+ import { CodeBlock } from "../markdown/code-block.js";
7
+ import { Markdown } from "../markdown/markdown.js";
8
+ import { findUnsupportedOpenUINode } from "../openui-schema.js";
7
9
  import { Fragment } from "react";
8
10
  import { jsx, jsxs } from "react/jsx-runtime";
9
11
  import { Minus } from "lucide-react";
@@ -259,4 +261,4 @@ function OpenUIArtifactRenderer({ schema, onAction, className, urlTransform }) {
259
261
  });
260
262
  }
261
263
  //#endregion
262
- export { OpenUIArtifactRenderer as t };
264
+ export { OpenUIArtifactRenderer };