@tulipfarm/sprout 0.0.0-stage → 0.1.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 (306) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +183 -2
  3. package/dist/components/accordion.d.ts +28 -0
  4. package/dist/components/accordion.js +26 -0
  5. package/dist/components/alert-dialog.d.ts +60 -0
  6. package/dist/components/alert-dialog.js +69 -0
  7. package/dist/components/alert.d.ts +30 -0
  8. package/dist/components/alert.js +35 -0
  9. package/dist/components/aspect-ratio.d.ts +7 -0
  10. package/dist/components/aspect-ratio.js +6 -0
  11. package/dist/components/attachment.d.ts +118 -0
  12. package/dist/components/attachment.js +285 -0
  13. package/dist/components/avatar.d.ts +32 -0
  14. package/dist/components/avatar.js +73 -0
  15. package/dist/components/badge.d.ts +21 -0
  16. package/dist/components/badge.js +27 -0
  17. package/dist/components/brand-icon.d.ts +28 -0
  18. package/dist/components/brand-icon.js +78 -0
  19. package/dist/components/breadcrumb.d.ts +29 -0
  20. package/dist/components/breadcrumb.js +44 -0
  21. package/dist/components/button-group.d.ts +28 -0
  22. package/dist/components/button-group.js +36 -0
  23. package/dist/components/button.d.ts +79 -0
  24. package/dist/components/button.js +93 -0
  25. package/dist/components/calendar.d.ts +27 -0
  26. package/dist/components/calendar.js +107 -0
  27. package/dist/components/canvas.d.ts +78 -0
  28. package/dist/components/canvas.js +180 -0
  29. package/dist/components/card.d.ts +43 -0
  30. package/dist/components/card.js +42 -0
  31. package/dist/components/carousel.d.ts +57 -0
  32. package/dist/components/carousel.js +422 -0
  33. package/dist/components/chart.d.ts +112 -0
  34. package/dist/components/chart.js +172 -0
  35. package/dist/components/chat-confirmation.d.ts +42 -0
  36. package/dist/components/chat-confirmation.js +62 -0
  37. package/dist/components/chat-plan.d.ts +21 -0
  38. package/dist/components/chat-plan.js +35 -0
  39. package/dist/components/chat-sources.d.ts +64 -0
  40. package/dist/components/chat-sources.js +66 -0
  41. package/dist/components/checkbox.d.ts +16 -0
  42. package/dist/components/checkbox.js +17 -0
  43. package/dist/components/choice-list.d.ts +53 -0
  44. package/dist/components/choice-list.js +36 -0
  45. package/dist/components/code-block.d.ts +35 -0
  46. package/dist/components/code-block.js +95 -0
  47. package/dist/components/collapsible.d.ts +24 -0
  48. package/dist/components/collapsible.js +27 -0
  49. package/dist/components/combobox.d.ts +95 -0
  50. package/dist/components/combobox.js +106 -0
  51. package/dist/components/command.d.ts +94 -0
  52. package/dist/components/command.js +414 -0
  53. package/dist/components/context-menu.d.ts +57 -0
  54. package/dist/components/context-menu.js +60 -0
  55. package/dist/components/dialog.d.ts +60 -0
  56. package/dist/components/dialog.js +79 -0
  57. package/dist/components/direction.d.ts +6 -0
  58. package/dist/components/direction.js +6 -0
  59. package/dist/components/dropdown-menu.d.ts +62 -0
  60. package/dist/components/dropdown-menu.js +59 -0
  61. package/dist/components/field.d.ts +117 -0
  62. package/dist/components/field.js +150 -0
  63. package/dist/components/file-viewer.d.ts +120 -0
  64. package/dist/components/file-viewer.js +373 -0
  65. package/dist/components/form.d.ts +87 -0
  66. package/dist/components/form.js +55 -0
  67. package/dist/components/glass-banner.d.ts +27 -0
  68. package/dist/components/glass-banner.js +116 -0
  69. package/dist/components/gradient-banner.d.ts +37 -0
  70. package/dist/components/gradient-banner.js +43 -0
  71. package/dist/components/hover-card.d.ts +27 -0
  72. package/dist/components/hover-card.js +26 -0
  73. package/dist/components/input-group.d.ts +68 -0
  74. package/dist/components/input-group.js +88 -0
  75. package/dist/components/input-otp.d.ts +38 -0
  76. package/dist/components/input-otp.js +43 -0
  77. package/dist/components/input.d.ts +16 -0
  78. package/dist/components/input.js +18 -0
  79. package/dist/components/kbd.d.ts +12 -0
  80. package/dist/components/kbd.js +11 -0
  81. package/dist/components/label.d.ts +8 -0
  82. package/dist/components/label.js +10 -0
  83. package/dist/components/mention-list.d.ts +54 -0
  84. package/dist/components/mention-list.js +31 -0
  85. package/dist/components/menubar.d.ts +64 -0
  86. package/dist/components/menubar.js +68 -0
  87. package/dist/components/message-actions.d.ts +34 -0
  88. package/dist/components/message-actions.js +68 -0
  89. package/dist/components/message-response.d.ts +20 -0
  90. package/dist/components/message-response.js +46 -0
  91. package/dist/components/message-scroller.d.ts +71 -0
  92. package/dist/components/message-scroller.js +217 -0
  93. package/dist/components/message.d.ts +49 -0
  94. package/dist/components/message.js +59 -0
  95. package/dist/components/navigation-menu.d.ts +45 -0
  96. package/dist/components/navigation-menu.js +54 -0
  97. package/dist/components/notice-banner.d.ts +14 -0
  98. package/dist/components/notice-banner.js +11 -0
  99. package/dist/components/page-content.d.ts +7 -0
  100. package/dist/components/page-content.js +9 -0
  101. package/dist/components/page-header.d.ts +37 -0
  102. package/dist/components/page-header.js +53 -0
  103. package/dist/components/pagination.d.ts +29 -0
  104. package/dist/components/pagination.js +29 -0
  105. package/dist/components/plan-outline.d.ts +60 -0
  106. package/dist/components/plan-outline.js +108 -0
  107. package/dist/components/popover.d.ts +34 -0
  108. package/dist/components/popover.js +35 -0
  109. package/dist/components/progress.d.ts +27 -0
  110. package/dist/components/progress.js +35 -0
  111. package/dist/components/prompt-list.d.ts +23 -0
  112. package/dist/components/prompt-list.js +11 -0
  113. package/dist/components/questionnaire.d.ts +148 -0
  114. package/dist/components/questionnaire.js +1001 -0
  115. package/dist/components/radio-group.d.ts +16 -0
  116. package/dist/components/radio-group.js +21 -0
  117. package/dist/components/reasoning-effort.d.ts +24 -0
  118. package/dist/components/reasoning-effort.js +269 -0
  119. package/dist/components/resizable.d.ts +67 -0
  120. package/dist/components/resizable.js +536 -0
  121. package/dist/components/result-card.d.ts +58 -0
  122. package/dist/components/result-card.js +88 -0
  123. package/dist/components/review-card.d.ts +62 -0
  124. package/dist/components/review-card.js +49 -0
  125. package/dist/components/rich-text-editor.d.ts +51 -0
  126. package/dist/components/rich-text-editor.js +248 -0
  127. package/dist/components/schema-diagram.d.ts +52 -0
  128. package/dist/components/schema-diagram.js +226 -0
  129. package/dist/components/scroll-area.d.ts +22 -0
  130. package/dist/components/scroll-area.js +19 -0
  131. package/dist/components/search-dialog.d.ts +103 -0
  132. package/dist/components/search-dialog.js +64 -0
  133. package/dist/components/search-field.d.ts +17 -0
  134. package/dist/components/search-field.js +27 -0
  135. package/dist/components/select.d.ts +57 -0
  136. package/dist/components/select.js +57 -0
  137. package/dist/components/selection-slot.d.ts +18 -0
  138. package/dist/components/selection-slot.js +53 -0
  139. package/dist/components/separator.d.ts +48 -0
  140. package/dist/components/separator.js +54 -0
  141. package/dist/components/settings-list.d.ts +26 -0
  142. package/dist/components/settings-list.js +17 -0
  143. package/dist/components/sheet.d.ts +70 -0
  144. package/dist/components/sheet.js +77 -0
  145. package/dist/components/sidebar.d.ts +70 -0
  146. package/dist/components/sidebar.js +187 -0
  147. package/dist/components/skeleton.d.ts +31 -0
  148. package/dist/components/skeleton.js +32 -0
  149. package/dist/components/slider.d.ts +17 -0
  150. package/dist/components/slider.js +24 -0
  151. package/dist/components/spinner.d.ts +37 -0
  152. package/dist/components/spinner.js +43 -0
  153. package/dist/components/state-panel-samples.d.ts +25 -0
  154. package/dist/components/state-panel-samples.js +423 -0
  155. package/dist/components/state-panel.d.ts +35 -0
  156. package/dist/components/state-panel.js +29 -0
  157. package/dist/components/state-sample.d.ts +63 -0
  158. package/dist/components/state-sample.js +42 -0
  159. package/dist/components/switch.d.ts +12 -0
  160. package/dist/components/switch.js +14 -0
  161. package/dist/components/table-nuqs.d.ts +16 -0
  162. package/dist/components/table-nuqs.js +59 -0
  163. package/dist/components/table.d.ts +120 -0
  164. package/dist/components/table.js +663 -0
  165. package/dist/components/tabs.d.ts +37 -0
  166. package/dist/components/tabs.js +36 -0
  167. package/dist/components/textarea.d.ts +18 -0
  168. package/dist/components/textarea.js +19 -0
  169. package/dist/components/toast.d.ts +45 -0
  170. package/dist/components/toast.js +83 -0
  171. package/dist/components/toggle-group.d.ts +30 -0
  172. package/dist/components/toggle-group.js +39 -0
  173. package/dist/components/toggle.d.ts +27 -0
  174. package/dist/components/toggle.js +21 -0
  175. package/dist/components/tool-activity.d.ts +79 -0
  176. package/dist/components/tool-activity.js +226 -0
  177. package/dist/components/toolbar-status.d.ts +21 -0
  178. package/dist/components/toolbar-status.js +14 -0
  179. package/dist/components/tooltip.d.ts +31 -0
  180. package/dist/components/tooltip.js +99 -0
  181. package/dist/components/typed-text.d.ts +17 -0
  182. package/dist/components/typed-text.js +56 -0
  183. package/dist/index.d.ts +88 -0
  184. package/dist/index.js +88 -0
  185. package/dist/internal/brand-glyphs.d.ts +342 -0
  186. package/dist/internal/brand-glyphs.js +238 -0
  187. package/dist/internal/classes.d.ts +3 -0
  188. package/dist/internal/classes.js +20 -0
  189. package/dist/internal/fieldset.d.ts +6 -0
  190. package/dist/internal/fieldset.js +38 -0
  191. package/dist/internal/file-kind.d.ts +4 -0
  192. package/dist/internal/file-kind.js +62 -0
  193. package/dist/internal/languages.d.ts +7 -0
  194. package/dist/internal/languages.js +1010 -0
  195. package/dist/internal/message-scroller.d.ts +102 -0
  196. package/dist/internal/message-scroller.js +637 -0
  197. package/dist/internal/pressable.d.ts +2 -0
  198. package/dist/internal/pressable.js +29 -0
  199. package/dist/internal/syntax.d.ts +14 -0
  200. package/dist/internal/syntax.js +137 -0
  201. package/dist/styles/accordion.css +102 -0
  202. package/dist/styles/alert-dialog.css +198 -0
  203. package/dist/styles/alert.css +149 -0
  204. package/dist/styles/aspect-ratio.css +8 -0
  205. package/dist/styles/attachment.css +720 -0
  206. package/dist/styles/avatar.css +186 -0
  207. package/dist/styles/badge.css +178 -0
  208. package/dist/styles/brand-icon.css +104 -0
  209. package/dist/styles/breadcrumb.css +121 -0
  210. package/dist/styles/button-group.css +113 -0
  211. package/dist/styles/button.css +380 -0
  212. package/dist/styles/calendar.css +295 -0
  213. package/dist/styles/canvas.css +327 -0
  214. package/dist/styles/card.css +146 -0
  215. package/dist/styles/carousel.css +107 -0
  216. package/dist/styles/chart.css +227 -0
  217. package/dist/styles/chat-confirmation.css +29 -0
  218. package/dist/styles/chat-plan.css +109 -0
  219. package/dist/styles/chat-sources.css +191 -0
  220. package/dist/styles/checkbox.css +123 -0
  221. package/dist/styles/choice-list.css +343 -0
  222. package/dist/styles/code-block.css +211 -0
  223. package/dist/styles/collapsible.css +72 -0
  224. package/dist/styles/combobox.css +347 -0
  225. package/dist/styles/command.css +233 -0
  226. package/dist/styles/context-menu.css +151 -0
  227. package/dist/styles/dialog.css +237 -0
  228. package/dist/styles/dropdown-menu.css +150 -0
  229. package/dist/styles/field.css +341 -0
  230. package/dist/styles/file-viewer.css +278 -0
  231. package/dist/styles/form.css +155 -0
  232. package/dist/styles/glass-banner.css +308 -0
  233. package/dist/styles/gradient-banner.css +256 -0
  234. package/dist/styles/hover-card.css +95 -0
  235. package/dist/styles/index.css +262 -0
  236. package/dist/styles/input-group.css +290 -0
  237. package/dist/styles/input-otp.css +138 -0
  238. package/dist/styles/input.css +99 -0
  239. package/dist/styles/kbd.css +59 -0
  240. package/dist/styles/label.css +89 -0
  241. package/dist/styles/mention-list.css +166 -0
  242. package/dist/styles/menubar.css +226 -0
  243. package/dist/styles/message-actions.css +83 -0
  244. package/dist/styles/message-response.css +176 -0
  245. package/dist/styles/message-scroller.css +136 -0
  246. package/dist/styles/message.css +310 -0
  247. package/dist/styles/navigation-menu.css +291 -0
  248. package/dist/styles/notice-banner.css +68 -0
  249. package/dist/styles/page-content.css +21 -0
  250. package/dist/styles/page-header.css +156 -0
  251. package/dist/styles/pagination.css +72 -0
  252. package/dist/styles/plan-outline.css +393 -0
  253. package/dist/styles/popover.css +140 -0
  254. package/dist/styles/progress.css +93 -0
  255. package/dist/styles/prompt-list.css +165 -0
  256. package/dist/styles/questionnaire.css +323 -0
  257. package/dist/styles/radio-group.css +120 -0
  258. package/dist/styles/reasoning-effort.css +157 -0
  259. package/dist/styles/resizable.css +108 -0
  260. package/dist/styles/result-card.css +215 -0
  261. package/dist/styles/review-card.css +235 -0
  262. package/dist/styles/rich-text-editor.css +169 -0
  263. package/dist/styles/schema-diagram.css +419 -0
  264. package/dist/styles/scroll-area.css +77 -0
  265. package/dist/styles/search-dialog.css +363 -0
  266. package/dist/styles/search-field.css +17 -0
  267. package/dist/styles/select.css +285 -0
  268. package/dist/styles/selection-slot.css +31 -0
  269. package/dist/styles/separator.css +206 -0
  270. package/dist/styles/settings-list.css +81 -0
  271. package/dist/styles/sheet.css +361 -0
  272. package/dist/styles/sidebar.css +363 -0
  273. package/dist/styles/skeleton.css +80 -0
  274. package/dist/styles/slider.css +142 -0
  275. package/dist/styles/spinner.css +39 -0
  276. package/dist/styles/state-panel-samples.css +41 -0
  277. package/dist/styles/state-panel.css +182 -0
  278. package/dist/styles/state-sample.css +285 -0
  279. package/dist/styles/switch.css +128 -0
  280. package/dist/styles/table.css +604 -0
  281. package/dist/styles/tabs.css +223 -0
  282. package/dist/styles/textarea.css +78 -0
  283. package/dist/styles/themes/chatgpt.css +125 -0
  284. package/dist/styles/themes/claude.css +125 -0
  285. package/dist/styles/themes/cloudflare.css +125 -0
  286. package/dist/styles/themes/discord.css +125 -0
  287. package/dist/styles/themes/github.css +125 -0
  288. package/dist/styles/themes/grok.css +125 -0
  289. package/dist/styles/themes/linear.css +126 -0
  290. package/dist/styles/themes/neutral.css +125 -0
  291. package/dist/styles/themes/notion.css +125 -0
  292. package/dist/styles/themes/perplexity.css +125 -0
  293. package/dist/styles/themes/raycast.css +125 -0
  294. package/dist/styles/themes/spotify.css +125 -0
  295. package/dist/styles/themes/stripe.css +125 -0
  296. package/dist/styles/themes/supabase.css +125 -0
  297. package/dist/styles/themes/tulipfarm.css +125 -0
  298. package/dist/styles/themes/vercel.css +126 -0
  299. package/dist/styles/toast.css +197 -0
  300. package/dist/styles/toggle-group.css +161 -0
  301. package/dist/styles/toggle.css +119 -0
  302. package/dist/styles/tool-activity.css +396 -0
  303. package/dist/styles/toolbar-status.css +52 -0
  304. package/dist/styles/tooltip.css +122 -0
  305. package/dist/styles/typed-text.css +17 -0
  306. package/package.json +443 -4
@@ -0,0 +1,35 @@
1
+ import { type HTMLAttributes } from "react";
2
+ import { type CodeLanguage } from "../internal/languages.js";
3
+ import { languageForFilename } from "../internal/syntax.js";
4
+ export type { CodeLanguage };
5
+ export { languageForFilename };
6
+ export declare const codeBlockVariantNames: readonly ["inline", "file", "preview"];
7
+ export type CodeBlockVariant = (typeof codeBlockVariantNames)[number];
8
+ /** Every language that gets syntax colors. Aliases and file extensions such as `ts`, `py`, and `yml` work too. */
9
+ export declare const codeBlockLanguages: readonly ["abap", "actionscript-3", "ada", "ahk", "ahk2", "angular-html", "angular-ts", "apache", "apex", "apl", "applescript", "ara", "asciidoc", "asm", "astro", "awk", "ballerina", "bat", "beancount", "berry", "bibtex", "bicep", "bird2", "blade", "bsl", "c", "c3", "cadence", "cairo", "chapel", "clarity", "clojure", "cmake", "cobol", "codeowners", "codeql", "coffee", "common-lisp", "coq", "cpp", "crystal", "csharp", "css", "csv", "cue", "cypher", "d", "dart", "dax", "desktop", "diff", "docker", "dotenv", "dream-maker", "edge", "elixir", "elm", "emacs-lisp", "erb", "erlang", "fennel", "fish", "fluent", "fortran-fixed-form", "fortran-free-form", "fsharp", "gdresource", "gdscript", "gdshader", "genie", "gherkin", "git-commit", "git-rebase", "gleam", "glimmer-js", "glimmer-ts", "glsl", "gn", "gnuplot", "go", "graphql", "groovy", "hack", "haml", "handlebars", "haskell", "haxe", "hcl", "hjson", "hlsl", "html", "html-derivative", "http", "hurl", "hxml", "hy", "imba", "ini", "java", "javascript", "jinja", "jison", "json", "json5", "jsonc", "jsonl", "jsonnet", "jssm", "jsx", "julia", "just", "kdl", "kotlin", "kusto", "latex", "lean", "less", "liquid", "llvm", "log", "logo", "lua", "luau", "make", "markdown", "marko", "matlab", "mdc", "mdx", "mermaid", "mipsasm", "mojo", "moonbit", "move", "narrat", "nextflow", "nextflow-groovy", "nginx", "nim", "nix", "nsis", "nushell", "objective-c", "objective-cpp", "ocaml", "odin", "openscad", "org", "pascal", "perl", "php", "pkl", "plsql", "po", "polar", "postcss", "powerquery", "powershell", "prisma", "prolog", "proto", "pug", "puppet", "purescript", "python", "qml", "qmldir", "qss", "r", "racket", "raku", "razor", "rbs", "reg", "regexp", "rel", "riscv", "ron", "rosmsg", "rst", "ruby", "rust", "sas", "sass", "scala", "scheme", "scss", "sdbl", "shaderlab", "shellscript", "shellsession", "smalltalk", "smithy", "solidity", "soy", "sparql", "splunk", "sql", "ssh-config", "stata", "stylus", "surrealql", "svelte", "swift", "system-verilog", "systemd", "talonscript", "tasl", "tcl", "templ", "terraform", "tex", "toml", "ts-tags", "tsv", "tsx", "turtle", "twig", "typescript", "typespec", "typst", "v", "vala", "vb", "verilog", "vhdl", "viml", "vue", "vue-html", "vue-vine", "vyper", "wasm", "wenyan", "wgsl", "wikitext", "wit", "wolfram", "xml", "xsl", "yaml", "zenscript", "zig"];
10
+ export type CodeBlockCopyState = "idle" | "copying" | "copied" | "error";
11
+ export interface CodeBlockProps extends Omit<HTMLAttributes<HTMLDivElement>, "children"> {
12
+ code: string;
13
+ /** A language name, alias, or extension. Defaults to the one `filename` implies, else plain text. */
14
+ language?: string | undefined;
15
+ /** Shown in the header instead of the language, and names the copy button and the scroll region. */
16
+ filename?: string | undefined;
17
+ lineNumbers?: boolean | undefined;
18
+ /** Wraps long lines instead of scrolling sideways, for prose such as notes and Markdown. Hides line numbers. */
19
+ wrap?: boolean | undefined;
20
+ /**
21
+ * `inline` is a bordered card capped at 24rem. `file` fills its parent's
22
+ * height without a frame. `preview` is a frameless, headerless snippet
23
+ * clipped to its parent, for hover cards and thumbnails.
24
+ */
25
+ variant?: CodeBlockVariant | undefined;
26
+ }
27
+ export declare function isHighlightedLanguage(language: string): boolean;
28
+ /** The display name for a language, alias, or extension, such as “TypeScript” for `ts`. */
29
+ export declare function codeLanguageName(language: string): string;
30
+ /**
31
+ * Loads the grammars for these languages, so the next render colors them
32
+ * at once. Await it before server rendering to send highlighted HTML.
33
+ */
34
+ export declare function preloadCodeLanguages(...languages: string[]): Promise<void>;
35
+ export declare function CodeBlock({ code, language, filename, lineNumbers, wrap, variant, className, ...props }: CodeBlockProps): import("react").JSX.Element;
@@ -0,0 +1,95 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { Fragment, useEffect, useMemo, useRef, useState, } from "react";
4
+ import { Check } from "reicon-react/icons/Check";
5
+ import { Copy } from "reicon-react/icons/Copy";
6
+ import { cn } from "../internal/classes.js";
7
+ import { codeLanguageIds, codeLanguageNames, } from "../internal/languages.js";
8
+ import { codeTokens, embeddedLanguages, isLanguageReady, languageForFilename, loadCodeLanguage, maxHighlightedLength, resolveCodeLanguage, } from "../internal/syntax.js";
9
+ import { Button } from "./button.js";
10
+ export { languageForFilename };
11
+ export const codeBlockVariantNames = ["inline", "file", "preview"];
12
+ /** Every language that gets syntax colors. Aliases and file extensions such as `ts`, `py`, and `yml` work too. */
13
+ export const codeBlockLanguages = codeLanguageIds;
14
+ const copiedResetMs = 2000;
15
+ export function isHighlightedLanguage(language) {
16
+ return resolveCodeLanguage(language) !== null;
17
+ }
18
+ /** The display name for a language, alias, or extension, such as “TypeScript” for `ts`. */
19
+ export function codeLanguageName(language) {
20
+ const resolved = resolveCodeLanguage(language);
21
+ return resolved ? codeLanguageNames[resolved] : "Plain text";
22
+ }
23
+ /**
24
+ * Loads the grammars for these languages, so the next render colors them
25
+ * at once. Await it before server rendering to send highlighted HTML.
26
+ */
27
+ export async function preloadCodeLanguages(...languages) {
28
+ await Promise.all(languages.flatMap((language) => {
29
+ const resolved = resolveCodeLanguage(language);
30
+ return resolved ? [loadCodeLanguage(resolved)] : [];
31
+ }));
32
+ }
33
+ function useCodeTokens(code, language) {
34
+ const [loaded, setLoaded] = useState(0);
35
+ const highlightable = language !== null && code.length <= maxHighlightedLength;
36
+ const needed = useMemo(() => highlightable ? [language, ...embeddedLanguages(code, language)] : [], [code, language, highlightable]);
37
+ const missing = needed.filter((name) => !isLanguageReady(name));
38
+ const key = missing.join(" ");
39
+ useEffect(() => {
40
+ if (!key)
41
+ return;
42
+ let live = true;
43
+ void Promise.all(key.split(" ").map((name) => loadCodeLanguage(name))).then(() => live && setLoaded((value) => value + 1), () => undefined);
44
+ return () => {
45
+ live = false;
46
+ };
47
+ }, [key]);
48
+ return useMemo(() => (highlightable ? codeTokens(code, language) : null),
49
+ // `loaded` and `key` re-run this once the grammars arrive.
50
+ [code, language, highlightable, loaded, key]);
51
+ }
52
+ const fontStyleClasses = [
53
+ [1, "sprout-syntax-italic"],
54
+ [2, "sprout-syntax-bold"],
55
+ [4, "sprout-syntax-underline"],
56
+ ];
57
+ function tokenClass(token) {
58
+ const role = /--sprout-syntax-(?:token-)?([a-z-]+)/.exec(token.color ?? "")?.[1];
59
+ const classes = role && role !== "foreground" ? [`sprout-syntax-${role}`] : [];
60
+ for (const [flag, name] of fontStyleClasses)
61
+ if ((token.fontStyle ?? 0) & flag)
62
+ classes.push(name);
63
+ return classes.length ? classes.join(" ") : undefined;
64
+ }
65
+ export function CodeBlock({ code, language, filename, lineNumbers = true, wrap = false, variant = "inline", className, ...props }) {
66
+ const [copyState, setCopyState] = useState("idle");
67
+ const timer = useRef(undefined);
68
+ useEffect(() => () => clearTimeout(timer.current), []);
69
+ const resolved = resolveCodeLanguage(language, filename);
70
+ const tokens = useCodeTokens(code, resolved);
71
+ const lineCount = useMemo(() => code.split("\n").length, [code]);
72
+ const copy = async () => {
73
+ clearTimeout(timer.current);
74
+ setCopyState("copying");
75
+ try {
76
+ await navigator.clipboard.writeText(code);
77
+ setCopyState("copied");
78
+ timer.current = setTimeout(() => setCopyState("idle"), copiedResetMs);
79
+ }
80
+ catch {
81
+ setCopyState("error");
82
+ }
83
+ };
84
+ const languageLabel = resolved ? codeLanguageNames[resolved] : "Plain text";
85
+ const label = filename ?? languageLabel;
86
+ const copied = copyState === "copied";
87
+ const preview = variant === "preview";
88
+ return (_jsxs("div", { "data-slot": "code-block", "data-variant": variant, "data-language": resolved ?? "text", "data-highlighted": tokens ? "" : undefined, "data-wrap": wrap ? "" : undefined, "data-copy-state": copyState, ...props, className: cn("sprout-code-block", className), children: [!preview && (_jsxs("div", { className: "sprout-code-block-header", children: [_jsx("span", { className: "sprout-code-block-label", children: label }), _jsxs(Button, { variant: "ghost", size: "sm", focusableWhenDisabled: true, disabled: copyState === "copying", onClick: () => void copy(), "aria-label": `Copy ${filename ?? "code"}`, className: "sprout-code-block-copy", children: [_jsx("span", { className: "sprout-code-block-icon", "aria-hidden": "true", children: copied ? _jsx(Check, { size: 14 }) : _jsx(Copy, { size: 14 }) }), copied ? "Copied" : "Copy"] })] })), _jsxs("div", { className: "sprout-code-block-viewport", ...(preview
89
+ ? {}
90
+ : {
91
+ tabIndex: 0,
92
+ role: "region",
93
+ "aria-label": filename ?? `${languageLabel} code`,
94
+ }), children: [lineNumbers && !wrap && (_jsx("pre", { "aria-hidden": "true", className: "sprout-code-block-gutter", children: Array.from({ length: lineCount }, (_, index) => index + 1).join("\n") })), _jsx("pre", { className: "sprout-code-block-pre", children: tokens ? (_jsx("code", { className: "sprout-code-block-syntax", children: tokens.map((line, row) => (_jsxs(Fragment, { children: [row > 0 && "\n", line.map((token, index) => (_jsx("span", { className: tokenClass(token), children: token.content }, index)))] }, row))) })) : (_jsx("code", { children: code })) })] }), copyState === "error" && (_jsx("p", { role: "alert", className: "sprout-code-block-error", children: "Clipboard unavailable. Select the code to copy it, or try Copy again." })), !preview && (_jsx("span", { className: "sprout-code-block-sr-only", role: "status", children: copied ? "Code copied to clipboard." : "" }))] }));
95
+ }
@@ -0,0 +1,24 @@
1
+ import { Collapsible as BaseCollapsible } from "@base-ui/react/collapsible";
2
+ export declare const collapsibleContentVariantNames: readonly ["default", "sidebar", "card"];
3
+ export type CollapsibleContentVariant = (typeof collapsibleContentVariantNames)[number];
4
+ export type CollapsibleProps = BaseCollapsible.Root.Props;
5
+ /**
6
+ * Shows and hides one region. Pass `open` and `onOpenChange` to control it,
7
+ * or `defaultOpen` to let it manage itself.
8
+ */
9
+ export declare function Collapsible({ className, ...props }: CollapsibleProps): import("react").JSX.Element;
10
+ export type CollapsibleTriggerProps = BaseCollapsible.Trigger.Props;
11
+ /**
12
+ * The button that opens and closes the content. Use `render` to make a
13
+ * Sprout `Button` or another control the trigger. Mark a chevron with
14
+ * `data-slot="collapsible-indicator"` and it turns while the content is open.
15
+ */
16
+ export declare function CollapsibleTrigger({ className, ...props }: CollapsibleTriggerProps): import("react").JSX.Element;
17
+ export interface CollapsibleContentProps extends BaseCollapsible.Panel.Props {
18
+ /**
19
+ * `default` shows and hides at once. `sidebar` grows and fades for
20
+ * navigation lists. `card` grows inside bordered cards.
21
+ */
22
+ variant?: CollapsibleContentVariant;
23
+ }
24
+ export declare function CollapsibleContent({ variant, className, ...props }: CollapsibleContentProps): import("react").JSX.Element;
@@ -0,0 +1,27 @@
1
+ "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { Collapsible as BaseCollapsible } from "@base-ui/react/collapsible";
4
+ import { stateClassName } from "../internal/classes.js";
5
+ export const collapsibleContentVariantNames = [
6
+ "default",
7
+ "sidebar",
8
+ "card",
9
+ ];
10
+ /**
11
+ * Shows and hides one region. Pass `open` and `onOpenChange` to control it,
12
+ * or `defaultOpen` to let it manage itself.
13
+ */
14
+ export function Collapsible({ className, ...props }) {
15
+ return (_jsx(BaseCollapsible.Root, { "data-slot": "collapsible", ...props, className: stateClassName("sprout-collapsible", className) }));
16
+ }
17
+ /**
18
+ * The button that opens and closes the content. Use `render` to make a
19
+ * Sprout `Button` or another control the trigger. Mark a chevron with
20
+ * `data-slot="collapsible-indicator"` and it turns while the content is open.
21
+ */
22
+ export function CollapsibleTrigger({ className, ...props }) {
23
+ return (_jsx(BaseCollapsible.Trigger, { "data-slot": "collapsible-trigger", ...props, className: stateClassName("sprout-collapsible-trigger", className) }));
24
+ }
25
+ export function CollapsibleContent({ variant = "default", className, ...props }) {
26
+ return (_jsx(BaseCollapsible.Panel, { "data-slot": "collapsible-content", "data-variant": variant, ...props, className: stateClassName(`sprout-collapsible-content sprout-collapsible-content-${variant}`, className) }));
27
+ }
@@ -0,0 +1,95 @@
1
+ import { Combobox as ComboboxPrimitive } from "@base-ui/react/combobox";
2
+ export type ComboboxProps<Value, Multiple extends boolean | undefined = false> = ComboboxPrimitive.Root.Props<Value, Multiple>;
3
+ /**
4
+ * Holds the value, the typed query, and the open state. It takes every Base
5
+ * UI combobox root prop, including `items`, `multiple`, `value`,
6
+ * `defaultValue`, `onValueChange`, `filter`, `disabled`, and `name`. Pass
7
+ * `items` so the list can filter and `ComboboxEmpty` knows when nothing
8
+ * matches.
9
+ */
10
+ export declare const Combobox: typeof ComboboxPrimitive.Root;
11
+ export type ComboboxValueProps = ComboboxPrimitive.Value.Props;
12
+ /**
13
+ * Renders the chosen value. Pass a function as children to turn the value
14
+ * into chips or a label, for example `(values) => values.map(...)`.
15
+ */
16
+ export declare function ComboboxValue(props: ComboboxValueProps): import("react").JSX.Element;
17
+ export type ComboboxTriggerProps = ComboboxPrimitive.Trigger.Props;
18
+ /**
19
+ * Opens the list. With no children it is an icon button named “Show
20
+ * options”. With children, such as a `ComboboxValue`, it shows them before
21
+ * the chevron; render it as a `Button` with `render` for a picker that keeps
22
+ * its search field inside the list.
23
+ */
24
+ export declare function ComboboxTrigger({ className, children, ...props }: ComboboxTriggerProps): import("react").JSX.Element;
25
+ export interface ComboboxInputProps extends Omit<ComboboxPrimitive.Input.Props, "className"> {
26
+ /** Classes for the surrounding `InputGroup`. */
27
+ className?: string;
28
+ /** Shows the chevron button that opens the list. On by default. */
29
+ showTrigger?: boolean;
30
+ /**
31
+ * Shows a clear button once there is a value. It replaces the chevron
32
+ * while it shows.
33
+ */
34
+ showClear?: boolean;
35
+ }
36
+ /**
37
+ * A search field in a Sprout `InputGroup`. Typing filters the list; the
38
+ * arrow keys, Enter, and Escape work as in a native list box. `className`
39
+ * goes on the group; children are added after the addon, for example an
40
+ * inline-start `InputGroupAddon` with an icon.
41
+ */
42
+ export declare function ComboboxInput({ className, children, disabled, showTrigger, showClear, ...props }: ComboboxInputProps): import("react").JSX.Element;
43
+ type PositionerProps = Pick<ComboboxPrimitive.Positioner.Props, "side" | "align" | "sideOffset" | "alignOffset" | "anchor">;
44
+ export interface ComboboxContentProps extends ComboboxPrimitive.Popup.Props, PositionerProps {
45
+ }
46
+ /**
47
+ * The list surface. It renders its own portal and positioner, opens below
48
+ * the field lined up to its start, and is at least as wide as the field.
49
+ * Pass `anchor` from `useComboboxAnchor` to line it up with a whole chips
50
+ * field instead of the text input.
51
+ */
52
+ export declare function ComboboxContent({ className, side, sideOffset, align, alignOffset, anchor, ...props }: ComboboxContentProps): import("react").JSX.Element;
53
+ export type ComboboxListProps = ComboboxPrimitive.List.Props;
54
+ /** Holds the items. Pass a function as children to render each filtered item. */
55
+ export declare function ComboboxList({ className, ...props }: ComboboxListProps): import("react").JSX.Element;
56
+ export type ComboboxItemProps = ComboboxPrimitive.Item.Props;
57
+ /** One choice. Long text wraps. A check mark shows when it is chosen. */
58
+ export declare function ComboboxItem({ className, children, ...props }: ComboboxItemProps): import("react").JSX.Element;
59
+ export type ComboboxGroupProps = ComboboxPrimitive.Group.Props;
60
+ /** Groups related items. Pass `items` and a `ComboboxCollection` to filter inside it. */
61
+ export declare function ComboboxGroup({ className, ...props }: ComboboxGroupProps): import("react").JSX.Element;
62
+ export type ComboboxLabelProps = ComboboxPrimitive.GroupLabel.Props;
63
+ /** A small muted heading that names a `ComboboxGroup`. */
64
+ export declare function ComboboxLabel({ className, ...props }: ComboboxLabelProps): import("react").JSX.Element;
65
+ export type ComboboxCollectionProps = ComboboxPrimitive.Collection.Props;
66
+ /** Renders the filtered items of the surrounding group with a function child. */
67
+ export declare function ComboboxCollection(props: ComboboxCollectionProps): import("react").JSX.Element;
68
+ export type ComboboxEmptyProps = ComboboxPrimitive.Empty.Props;
69
+ /**
70
+ * Shows its children only when no item matches, and announces them to
71
+ * screen readers. Keep it mounted; it takes no space while the list has
72
+ * items.
73
+ */
74
+ export declare function ComboboxEmpty({ className, ...props }: ComboboxEmptyProps): import("react").JSX.Element;
75
+ export type ComboboxSeparatorProps = ComboboxPrimitive.Separator.Props;
76
+ export declare function ComboboxSeparator({ className, ...props }: ComboboxSeparatorProps): import("react").JSX.Element;
77
+ export type ComboboxChipsProps = ComboboxPrimitive.Chips.Props;
78
+ /**
79
+ * The bordered field for `multiple` comboboxes. Put a `ComboboxValue` that
80
+ * renders `ComboboxChip`s and a `ComboboxChipsInput` inside it. Arrow left
81
+ * and right move between chips; Backspace removes one.
82
+ */
83
+ export declare function ComboboxChips({ className, ...props }: ComboboxChipsProps): import("react").JSX.Element;
84
+ export interface ComboboxChipProps extends ComboboxPrimitive.Chip.Props {
85
+ /** Shows the × button that removes the chip. On by default. */
86
+ showRemove?: boolean;
87
+ }
88
+ /** One chosen value inside `ComboboxChips`. */
89
+ export declare function ComboboxChip({ className, children, showRemove, ...props }: ComboboxChipProps): import("react").JSX.Element;
90
+ export type ComboboxChipsInputProps = ComboboxPrimitive.Input.Props;
91
+ /** The text input that sits after the chips and fills the rest of the row. */
92
+ export declare function ComboboxChipsInput({ className, ...props }: ComboboxChipsInputProps): import("react").JSX.Element;
93
+ /** A ref for `ComboboxChips` to pass as `ComboboxContent`’s `anchor`. */
94
+ export declare function useComboboxAnchor(): import("react").RefObject<HTMLDivElement | null>;
95
+ export {};
@@ -0,0 +1,106 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { useRef } from "react";
4
+ import { Combobox as ComboboxPrimitive } from "@base-ui/react/combobox";
5
+ import { Check } from "reicon-react/icons/Check";
6
+ import { ChevronDown } from "reicon-react/icons/ChevronDown";
7
+ import { X } from "reicon-react/icons/X";
8
+ import { cn, stateClassName } from "../internal/classes.js";
9
+ import { Button } from "./button.js";
10
+ import { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, } from "./input-group.js";
11
+ /**
12
+ * Holds the value, the typed query, and the open state. It takes every Base
13
+ * UI combobox root prop, including `items`, `multiple`, `value`,
14
+ * `defaultValue`, `onValueChange`, `filter`, `disabled`, and `name`. Pass
15
+ * `items` so the list can filter and `ComboboxEmpty` knows when nothing
16
+ * matches.
17
+ */
18
+ export const Combobox = ComboboxPrimitive.Root;
19
+ /**
20
+ * Renders the chosen value. Pass a function as children to turn the value
21
+ * into chips or a label, for example `(values) => values.map(...)`.
22
+ */
23
+ export function ComboboxValue(props) {
24
+ return _jsx(ComboboxPrimitive.Value, { "data-slot": "combobox-value", ...props });
25
+ }
26
+ /**
27
+ * Opens the list. With no children it is an icon button named “Show
28
+ * options”. With children, such as a `ComboboxValue`, it shows them before
29
+ * the chevron; render it as a `Button` with `render` for a picker that keeps
30
+ * its search field inside the list.
31
+ */
32
+ export function ComboboxTrigger({ className, children, ...props }) {
33
+ return (_jsxs(ComboboxPrimitive.Trigger, { "data-slot": "combobox-trigger", "aria-label": children == null ? "Show options" : undefined, ...props, className: stateClassName("sprout-combobox-trigger", className), children: [children, _jsx(ChevronDown, { "aria-hidden": "true", className: "sprout-combobox-trigger-icon" })] }));
34
+ }
35
+ function ComboboxClear({ className, ...props }) {
36
+ return (_jsx(ComboboxPrimitive.Clear, { "data-slot": "combobox-clear", "aria-label": "Clear selection", render: _jsx(InputGroupButton, { variant: "ghost", size: "icon-xs" }), ...props, className: stateClassName("sprout-combobox-clear", className), children: _jsx(X, { "aria-hidden": "true" }) }));
37
+ }
38
+ /**
39
+ * A search field in a Sprout `InputGroup`. Typing filters the list; the
40
+ * arrow keys, Enter, and Escape work as in a native list box. `className`
41
+ * goes on the group; children are added after the addon, for example an
42
+ * inline-start `InputGroupAddon` with an icon.
43
+ */
44
+ export function ComboboxInput({ className, children, disabled = false, showTrigger = true, showClear = false, ...props }) {
45
+ return (_jsxs(InputGroup, { className: cn("sprout-combobox-input-group", className), children: [_jsx(ComboboxPrimitive.Input, { render: _jsx(InputGroupInput, {}), disabled: disabled, ...props }), _jsxs(InputGroupAddon, { align: "inline-end", children: [showTrigger && (_jsx(InputGroupButton, { size: "icon-xs", variant: "ghost", render: _jsx(ComboboxTrigger, {}), "data-slot": "input-group-button", className: "sprout-combobox-input-trigger", disabled: disabled })), showClear && _jsx(ComboboxClear, { disabled: disabled })] }), children] }));
46
+ }
47
+ /**
48
+ * The list surface. It renders its own portal and positioner, opens below
49
+ * the field lined up to its start, and is at least as wide as the field.
50
+ * Pass `anchor` from `useComboboxAnchor` to line it up with a whole chips
51
+ * field instead of the text input.
52
+ */
53
+ export function ComboboxContent({ className, side = "bottom", sideOffset = 6, align = "start", alignOffset = 0, anchor, ...props }) {
54
+ return (_jsx(ComboboxPrimitive.Portal, { children: _jsx(ComboboxPrimitive.Positioner, { className: "sprout-combobox-positioner", side: side, sideOffset: sideOffset, align: align, alignOffset: alignOffset, anchor: anchor, collisionPadding: 8, children: _jsx(ComboboxPrimitive.Popup, { "data-slot": "combobox-content", "data-chips": !!anchor, ...props, className: stateClassName("sprout-combobox-content", className) }) }) }));
55
+ }
56
+ /** Holds the items. Pass a function as children to render each filtered item. */
57
+ export function ComboboxList({ className, ...props }) {
58
+ return (_jsx(ComboboxPrimitive.List, { "data-slot": "combobox-list", ...props, className: stateClassName("sprout-combobox-list", className) }));
59
+ }
60
+ /** One choice. Long text wraps. A check mark shows when it is chosen. */
61
+ export function ComboboxItem({ className, children, ...props }) {
62
+ return (_jsxs(ComboboxPrimitive.Item, { "data-slot": "combobox-item", ...props, className: stateClassName("sprout-combobox-item", className), children: [children, _jsx(ComboboxPrimitive.ItemIndicator, { className: "sprout-combobox-item-indicator", render: _jsx("span", {}), children: _jsx(Check, { "aria-hidden": "true" }) })] }));
63
+ }
64
+ /** Groups related items. Pass `items` and a `ComboboxCollection` to filter inside it. */
65
+ export function ComboboxGroup({ className, ...props }) {
66
+ return (_jsx(ComboboxPrimitive.Group, { "data-slot": "combobox-group", ...props, className: stateClassName("sprout-combobox-group", className) }));
67
+ }
68
+ /** A small muted heading that names a `ComboboxGroup`. */
69
+ export function ComboboxLabel({ className, ...props }) {
70
+ return (_jsx(ComboboxPrimitive.GroupLabel, { "data-slot": "combobox-label", ...props, className: stateClassName("sprout-combobox-label", className) }));
71
+ }
72
+ /** Renders the filtered items of the surrounding group with a function child. */
73
+ export function ComboboxCollection(props) {
74
+ return (_jsx(ComboboxPrimitive.Collection, { "data-slot": "combobox-collection", ...props }));
75
+ }
76
+ /**
77
+ * Shows its children only when no item matches, and announces them to
78
+ * screen readers. Keep it mounted; it takes no space while the list has
79
+ * items.
80
+ */
81
+ export function ComboboxEmpty({ className, ...props }) {
82
+ return (_jsx(ComboboxPrimitive.Empty, { "data-slot": "combobox-empty", ...props, className: stateClassName("sprout-combobox-empty", className) }));
83
+ }
84
+ export function ComboboxSeparator({ className, ...props }) {
85
+ return (_jsx(ComboboxPrimitive.Separator, { "data-slot": "combobox-separator", ...props, className: stateClassName("sprout-combobox-separator", className) }));
86
+ }
87
+ /**
88
+ * The bordered field for `multiple` comboboxes. Put a `ComboboxValue` that
89
+ * renders `ComboboxChip`s and a `ComboboxChipsInput` inside it. Arrow left
90
+ * and right move between chips; Backspace removes one.
91
+ */
92
+ export function ComboboxChips({ className, ...props }) {
93
+ return (_jsx(ComboboxPrimitive.Chips, { "data-slot": "combobox-chips", ...props, className: stateClassName("sprout-combobox-chips", className) }));
94
+ }
95
+ /** One chosen value inside `ComboboxChips`. */
96
+ export function ComboboxChip({ className, children, showRemove = true, ...props }) {
97
+ return (_jsxs(ComboboxPrimitive.Chip, { "data-slot": "combobox-chip", ...props, className: stateClassName("sprout-combobox-chip", className), children: [children, showRemove && (_jsx(ComboboxPrimitive.ChipRemove, { "aria-label": typeof children === "string" ? `Remove ${children}` : "Remove item", render: _jsx(Button, { variant: "ghost", size: "icon-xs" }), className: "sprout-combobox-chip-remove", "data-slot": "combobox-chip-remove", children: _jsx(X, { "aria-hidden": "true" }) }))] }));
98
+ }
99
+ /** The text input that sits after the chips and fills the rest of the row. */
100
+ export function ComboboxChipsInput({ className, ...props }) {
101
+ return (_jsx(ComboboxPrimitive.Input, { "data-slot": "combobox-chip-input", ...props, className: stateClassName("sprout-combobox-chips-input", className) }));
102
+ }
103
+ /** A ref for `ComboboxChips` to pass as `ComboboxContent`’s `anchor`. */
104
+ export function useComboboxAnchor() {
105
+ return useRef(null);
106
+ }
@@ -0,0 +1,94 @@
1
+ import { type ChangeEvent, type ComponentProps, type ReactNode } from "react";
2
+ import { type DialogContentProps, type DialogProps } from "./dialog.js";
3
+ /** Scores how well `value` and `keywords` match `search`. `0` hides the item; higher ranks first. */
4
+ export type CommandFilter = (value: string, search: string, keywords?: readonly string[]) => number;
5
+ /**
6
+ * The default filter. Every word of the search must appear in the value or a
7
+ * keyword, as a substring or in order with gaps. Prefix and word-start matches
8
+ * rank above loose ones. Case and accents are ignored.
9
+ */
10
+ export declare const defaultCommandFilter: CommandFilter;
11
+ export interface CommandProps extends ComponentProps<"div"> {
12
+ /** Accessible name for the search input when it has no `aria-label`. */
13
+ label?: string;
14
+ /** Set to `false` to filter items yourself and render only the matches. */
15
+ shouldFilter?: boolean;
16
+ /** Custom scoring. Return `0` to hide an item. */
17
+ filter?: CommandFilter;
18
+ /** Wrap from the last item to the first with the arrow keys. */
19
+ loop?: boolean;
20
+ }
21
+ /**
22
+ * A searchable list of actions. Type to filter, move with the arrow keys,
23
+ * and press Enter to choose. Focus stays in the search input while the
24
+ * active item is announced through `aria-activedescendant`.
25
+ */
26
+ export declare function Command({ label, shouldFilter, filter, loop, className, children, onKeyDown, ref, ...props }: CommandProps): import("react").JSX.Element;
27
+ export interface CommandInputProps extends Omit<ComponentProps<"input">, "value" | "defaultValue" | "onChange" | "type"> {
28
+ /** Controlled search text. */
29
+ value?: string;
30
+ onValueChange?: (search: string) => void;
31
+ onChange?: (event: ChangeEvent<HTMLInputElement>) => void;
32
+ }
33
+ /** The search field with a leading magnifier. It drives filtering and keyboard navigation. */
34
+ export declare function CommandInput({ value, onValueChange, onChange, className, id, ...props }: CommandInputProps): import("react").JSX.Element;
35
+ export type CommandListProps = ComponentProps<"div">;
36
+ /**
37
+ * The scrolling listbox. It caps at 18rem and keeps the active item in view.
38
+ * While nothing matches it drops the listbox role so `CommandEmpty` can hold
39
+ * ordinary content such as a Clear search button.
40
+ */
41
+ export declare function CommandList({ className, children, ...props }: CommandListProps): import("react").JSX.Element;
42
+ export type CommandEmptyProps = ComponentProps<"div">;
43
+ /** Shown only when no item matches the search. It can hold a recovery action. */
44
+ export declare function CommandEmpty({ className, ...props }: CommandEmptyProps): import("react").JSX.Element | null;
45
+ export interface CommandGroupProps extends Omit<ComponentProps<"div">, "value"> {
46
+ /** Small muted label above the items. Omit for an unlabeled group. */
47
+ heading?: ReactNode;
48
+ /** Keep the group visible even when none of its items match. */
49
+ forceMount?: boolean;
50
+ }
51
+ /** Groups related items under an optional heading. It hides when none of its items match. */
52
+ export declare function CommandGroup({ heading, forceMount, className, children, style, ...props }: CommandGroupProps): import("react").JSX.Element;
53
+ export interface CommandSeparatorProps extends ComponentProps<"div"> {
54
+ /** Keep the line while searching. By default it hides once the user types. */
55
+ alwaysRender?: boolean;
56
+ }
57
+ export declare function CommandSeparator({ alwaysRender, className, ...props }: CommandSeparatorProps): import("react").JSX.Element | null;
58
+ export interface CommandItemProps extends Omit<ComponentProps<"div">, "value" | "onSelect"> {
59
+ /** Text the filter matches and `onSelect` receives. Defaults to the item's text. */
60
+ value?: string;
61
+ /** Extra words that match this item, such as a name when `value` is an id. */
62
+ keywords?: readonly string[];
63
+ disabled?: boolean;
64
+ /** Runs on click or Enter. */
65
+ onSelect?: (value: string) => void;
66
+ /** Keep the item visible even when it doesn't match the search. */
67
+ forceMount?: boolean;
68
+ /** `true` shows a trailing check for the current choice. Hidden when the item has a shortcut. */
69
+ "data-checked"?: boolean;
70
+ }
71
+ /**
72
+ * One choice. Put an icon first, then the label. A trailing check marks the
73
+ * current choice with `data-checked`; a `CommandShortcut` replaces it.
74
+ */
75
+ export declare function CommandItem({ value, keywords, disabled, onSelect, forceMount, className, children, style, onClick, onPointerMove, onPointerDown, ...props }: CommandItemProps): import("react").JSX.Element | null;
76
+ export type CommandShortcutProps = ComponentProps<"span">;
77
+ /** A keyboard hint at the end of an item. */
78
+ export declare function CommandShortcut({ className, ...props }: CommandShortcutProps): import("react").JSX.Element;
79
+ export interface CommandDialogProps extends Omit<DialogProps, "children"> {
80
+ /** Visually hidden dialog title. */
81
+ title?: string;
82
+ /** Visually hidden dialog description. */
83
+ description?: string;
84
+ className?: string;
85
+ /** Adds the corner close button. Defaults to `false`; Escape closes the palette. */
86
+ showCloseButton?: boolean;
87
+ closeLabel?: string;
88
+ /** Where the portal renders. Defaults to `document.body`. */
89
+ container?: DialogContentProps["container"];
90
+ /** Usually a `Command`. */
91
+ children: ReactNode;
92
+ }
93
+ /** A command palette pinned near the top of the viewport. */
94
+ export declare function CommandDialog({ title, description, className, showCloseButton, closeLabel, container, children, ...props }: CommandDialogProps): import("react").JSX.Element;