@vercel/geistdocs 1.4.1 → 1.6.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 (52) hide show
  1. package/dist/assets/logos/logo-ai-elements.d.ts +0 -3
  2. package/dist/assets/logos/logo-ai-elements.d.ts.map +1 -1
  3. package/dist/assets/logos/logo-ai-elements.js +0 -3
  4. package/dist/assets/logos/logo-ai-sdk.d.ts +0 -3
  5. package/dist/assets/logos/logo-ai-sdk.d.ts.map +1 -1
  6. package/dist/assets/logos/logo-ai-sdk.js +0 -3
  7. package/dist/assets/logos/logo-chat-sdk.d.ts +0 -3
  8. package/dist/assets/logos/logo-chat-sdk.d.ts.map +1 -1
  9. package/dist/assets/logos/logo-chat-sdk.js +0 -3
  10. package/dist/assets/logos/logo-flags-sdk.d.ts +0 -3
  11. package/dist/assets/logos/logo-flags-sdk.d.ts.map +1 -1
  12. package/dist/assets/logos/logo-flags-sdk.js +0 -3
  13. package/dist/assets/logos/logo-icon-vercel.d.ts +0 -4
  14. package/dist/assets/logos/logo-icon-vercel.d.ts.map +1 -1
  15. package/dist/assets/logos/logo-icon-vercel.js +0 -4
  16. package/dist/assets/logos/logo-nextjs.d.ts +0 -3
  17. package/dist/assets/logos/logo-nextjs.d.ts.map +1 -1
  18. package/dist/assets/logos/logo-nextjs.js +5 -4
  19. package/dist/assets/logos/logo-streamdown.d.ts +0 -3
  20. package/dist/assets/logos/logo-streamdown.d.ts.map +1 -1
  21. package/dist/assets/logos/logo-streamdown.js +0 -3
  22. package/dist/assets/logos/logo-svelte-kit.d.ts.map +1 -1
  23. package/dist/assets/logos/logo-svelte-kit.js +1 -1
  24. package/dist/assets/logos/logo-vercel-oss.d.ts +0 -3
  25. package/dist/assets/logos/logo-vercel-oss.d.ts.map +1 -1
  26. package/dist/assets/logos/logo-vercel-oss.js +0 -3
  27. package/dist/assets/logos/logo-workflow-sdk.d.ts +0 -3
  28. package/dist/assets/logos/logo-workflow-sdk.d.ts.map +1 -1
  29. package/dist/assets/logos/logo-workflow-sdk.js +0 -3
  30. package/dist/cli/index.js +1 -1
  31. package/dist/components/badge.d.ts +11 -0
  32. package/dist/components/badge.d.ts.map +1 -0
  33. package/dist/components/badge.js +22 -0
  34. package/dist/components/code-block.d.ts.map +1 -1
  35. package/dist/components/code-block.js +32 -3
  36. package/dist/components/command-prompt.d.ts +33 -0
  37. package/dist/components/command-prompt.d.ts.map +1 -0
  38. package/dist/components/command-prompt.js +217 -0
  39. package/dist/controls.d.ts.map +1 -1
  40. package/dist/controls.js +3 -3
  41. package/dist/versions.js +1 -1
  42. package/docs/agents.md +1 -1
  43. package/docs/llms.txt +27 -1
  44. package/docs/manifest.json +1 -1
  45. package/docs/pages/syntax.md +26 -0
  46. package/package.json +9 -1
  47. package/template/app/[lang]/(home)/components/hero.tsx +1 -1
  48. package/template/app/[lang]/(home)/page.tsx +2 -2
  49. package/template/content/docs/syntax.mdx +26 -0
  50. package/template/package.json +1 -1
  51. package/template/components/ui/badge.tsx +0 -46
  52. package/template/components/ui/command-prompt.tsx +0 -488
@@ -0,0 +1,217 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { IconCheck } from "@vercel/geistdocs/assets/icons/icon-check";
4
+ import { IconCopy } from "@vercel/geistdocs/assets/icons/icon-copy";
5
+ import { AnimatePresence, motion, useReducedMotion } from "motion/react";
6
+ import { Children, createContext, isValidElement, useContext, useEffect, useLayoutEffect, useRef, useState, } from "react";
7
+ import { cn } from "../internal/cn";
8
+ const CommandPromptContext = createContext(null);
9
+ function useCommandPromptContext(component) {
10
+ const context = useContext(CommandPromptContext);
11
+ if (!context) {
12
+ throw new Error(`${component} must be used within CommandPrompt.Root`);
13
+ }
14
+ return context;
15
+ }
16
+ export function CommandPromptRoot({ value: valueProp, defaultValue, onValueChange, className, children, ...props }) {
17
+ const [uncontrolledValue, setUncontrolledValue] = useState(defaultValue ?? "");
18
+ const [copied, setCopied] = useState(false);
19
+ const [activeCopyValue, setActiveCopyValue] = useState("");
20
+ const [commandWidth, setCommandWidth] = useState();
21
+ const [isOverflowing, setIsOverflowing] = useState(false);
22
+ const [canShowGradient, setCanShowGradient] = useState(true);
23
+ const timeoutRef = useRef(null);
24
+ const value = valueProp ?? uncontrolledValue;
25
+ useEffect(() => {
26
+ return () => {
27
+ if (timeoutRef.current) {
28
+ clearTimeout(timeoutRef.current);
29
+ }
30
+ };
31
+ }, []);
32
+ function resetCopiedState() {
33
+ setCopied(false);
34
+ if (timeoutRef.current) {
35
+ clearTimeout(timeoutRef.current);
36
+ }
37
+ }
38
+ function setValue(nextValue) {
39
+ if (valueProp === undefined) {
40
+ setUncontrolledValue(nextValue);
41
+ }
42
+ resetCopiedState();
43
+ onValueChange?.(nextValue);
44
+ }
45
+ function copyActiveValue() {
46
+ if (!activeCopyValue) {
47
+ return;
48
+ }
49
+ navigator.clipboard.writeText(activeCopyValue);
50
+ setCopied(true);
51
+ if (timeoutRef.current) {
52
+ clearTimeout(timeoutRef.current);
53
+ }
54
+ timeoutRef.current = setTimeout(() => setCopied(false), 1000);
55
+ }
56
+ return (_jsx(CommandPromptContext.Provider, { value: {
57
+ value,
58
+ setValue,
59
+ copied,
60
+ copyActiveValue,
61
+ activeCopyValue,
62
+ setActiveCopyValue,
63
+ commandWidth,
64
+ setCommandWidth,
65
+ isOverflowing,
66
+ setIsOverflowing,
67
+ canShowGradient,
68
+ setCanShowGradient,
69
+ }, children: _jsx("div", { className: cn("flex w-full flex-col items-center gap-2", className), ...props, children: children }) }));
70
+ }
71
+ export function CommandPromptList({ className, ...props }) {
72
+ return _jsx("div", { className: cn("flex items-center", className), ...props });
73
+ }
74
+ export function CommandPromptTrigger({ value, className, onClick, children, ...props }) {
75
+ const context = useCommandPromptContext("CommandPrompt.Trigger");
76
+ const active = context.value === value;
77
+ return (_jsx("button", { "aria-pressed": active, className: cn("cursor-pointer px-3 py-2 text-gray-900 hover:text-gray-1000", "touch-manipulation rounded-sm border-none bg-transparent font-medium! text-label-13!", "outline outline-2 outline-transparent outline-offset-2 focus-visible:outline-[var(--ds-focus-color)]", "text-gray-900 data-[active]:font-medium data-[active]:text-gray-1000", "flex items-center gap-1.5 whitespace-nowrap", className), "data-active": active ? "" : undefined, onClick: (event) => {
78
+ onClick?.(event);
79
+ if (event.defaultPrevented) {
80
+ return;
81
+ }
82
+ context.setValue(value);
83
+ }, type: "button", ...props, children: children }));
84
+ }
85
+ export function CommandPromptTriggerDivider({ className, ...props }) {
86
+ return (_jsx("div", { "aria-hidden": true, className: cn("h-3 w-px bg-gray-400", className), ...props }));
87
+ }
88
+ export function CommandPromptSurface({ className, onClick, children, }) {
89
+ const context = useCommandPromptContext("CommandPrompt.Surface");
90
+ const shouldReduceMotion = useReducedMotion();
91
+ return (_jsx(motion.div, { className: cn("group material-small relative flex max-w-[calc(100vw-48px)] items-center gap-1 rounded-full py-2 pr-3 pl-5 transition-colors", className), layout: true, onClick: (event) => {
92
+ onClick?.(event);
93
+ if (event.defaultPrevented) {
94
+ return;
95
+ }
96
+ if (window.getSelection()?.toString()) {
97
+ return;
98
+ }
99
+ context.copyActiveValue();
100
+ }, transition: shouldReduceMotion
101
+ ? { duration: 0 }
102
+ : { type: "spring", bounce: 0, duration: 0.4 }, children: children }));
103
+ }
104
+ export function CommandPromptPrefix({ className, ...props }) {
105
+ return (_jsx("span", { className: cn("block pr-1 text-gray-500 text-label-16-mono!", className), ...props }));
106
+ }
107
+ export function CommandPromptViewport({ className, children, }) {
108
+ const context = useCommandPromptContext("CommandPrompt.Viewport");
109
+ const shouldReduceMotion = useReducedMotion();
110
+ const { commandWidth, canShowGradient, isOverflowing, setActiveCopyValue, setCanShowGradient, setCommandWidth, setIsOverflowing, } = context;
111
+ const measureRef = useRef(null);
112
+ const scrollObserverCleanup = useRef(null);
113
+ const items = Children.toArray(children)
114
+ .filter((child) => isValidElement(child))
115
+ .map((child) => child.props);
116
+ const activeItem = items.find((item) => item.value === context.value);
117
+ const command = activeItem?.children ?? null;
118
+ const fallbackCopyValue = typeof command === "string" || typeof command === "number"
119
+ ? String(command)
120
+ : Children.toArray(command)
121
+ .filter((child) => typeof child === "string" || typeof child === "number")
122
+ .join("");
123
+ const copyValue = activeItem?.copyValue ?? fallbackCopyValue;
124
+ // biome-ignore lint/correctness/useExhaustiveDependencies: copyValue must reset the overflow/gradient state when the active command changes.
125
+ useLayoutEffect(() => {
126
+ setIsOverflowing(false);
127
+ setCanShowGradient(Boolean(shouldReduceMotion));
128
+ }, [copyValue, setCanShowGradient, setIsOverflowing, shouldReduceMotion]);
129
+ useEffect(() => {
130
+ setActiveCopyValue(copyValue);
131
+ return () => {
132
+ setIsOverflowing(false);
133
+ scrollObserverCleanup.current?.();
134
+ scrollObserverCleanup.current = null;
135
+ };
136
+ }, [copyValue, setActiveCopyValue, setIsOverflowing]);
137
+ // biome-ignore lint/correctness/useExhaustiveDependencies: command/copyValue must re-measure the width to drive the resize animation when the active command changes.
138
+ useLayoutEffect(() => {
139
+ if (!measureRef.current) {
140
+ return;
141
+ }
142
+ setCommandWidth(measureRef.current.getBoundingClientRect().width);
143
+ }, [command, copyValue, setCommandWidth]);
144
+ return (_jsxs(motion.span, { animate: commandWidth === undefined
145
+ ? undefined
146
+ : { width: shouldReduceMotion ? "auto" : commandWidth }, className: cn("relative block min-w-0 overflow-hidden text-gray-1000 text-label-14-mono!", className), initial: false, onAnimationComplete: () => {
147
+ setCanShowGradient(true);
148
+ }, transition: shouldReduceMotion
149
+ ? { duration: 0 }
150
+ : { type: "spring", bounce: 0, duration: 0.4 }, children: [_jsx("span", { "aria-hidden": true, className: "pointer-events-none invisible absolute whitespace-nowrap", ref: measureRef, children: command }), _jsx(AnimatePresence, { initial: false, mode: "wait", children: Children.toArray(children).map((child) => {
151
+ if (!isValidElement(child)) {
152
+ return null;
153
+ }
154
+ if (child.props.value !== context.value) {
155
+ return null;
156
+ }
157
+ return (_jsx(motion.span, { animate: { opacity: 1, filter: "blur(0px)" }, className: cn("block min-w-0 whitespace-nowrap py-2", canShowGradient && isOverflowing
158
+ ? "overflow-x-auto"
159
+ : "overflow-x-hidden", child.props.className), exit: { opacity: 0, filter: "blur(1px)" }, initial: { opacity: 0, filter: "blur(1px)" }, ref: (element) => {
160
+ scrollObserverCleanup.current?.();
161
+ scrollObserverCleanup.current = null;
162
+ if (!element) {
163
+ return;
164
+ }
165
+ const checkOverflow = () => {
166
+ setIsOverflowing(element.scrollWidth > element.clientWidth);
167
+ };
168
+ checkOverflow();
169
+ const observer = new ResizeObserver(checkOverflow);
170
+ observer.observe(element);
171
+ scrollObserverCleanup.current = () => observer.disconnect();
172
+ }, transition: shouldReduceMotion ? { duration: 0 } : { duration: 0.15 }, children: child.props.children }, copyValue));
173
+ }) }), _jsx(AnimatePresence, { children: canShowGradient && isOverflowing && (_jsx(motion.span, { animate: { opacity: 1 }, "aria-hidden": true, className: "pointer-events-none absolute top-0 right-0 bottom-0 z-10 block w-4 bg-gradient-to-r from-transparent to-background-100", exit: { opacity: 0 }, initial: { opacity: 0 }, transition: shouldReduceMotion ? { duration: 0 } : { duration: 0.2 } })) })] }));
174
+ }
175
+ export function CommandPromptContent(_props) {
176
+ return null;
177
+ }
178
+ export function CommandPromptCopy({ className, onClick, ...props }) {
179
+ const context = useCommandPromptContext("CommandPrompt.Copy");
180
+ const shouldReduceMotion = useReducedMotion();
181
+ return (_jsxs("button", { "aria-label": context.copied ? "Copied" : "Copy command", className: cn("relative flex size-8 shrink-0 translate-x-0.5 cursor-pointer items-center justify-center rounded-full border-none bg-transparent text-gray-1000", "hover:!bg-gray-alpha-200 touch-manipulation transition-colors group-hover:bg-gray-alpha-100", "outline-2 outline-transparent outline-offset-2 focus-visible:outline-[var(--ds-focus-color)]", className), onClick: (event) => {
182
+ onClick?.(event);
183
+ if (event.defaultPrevented) {
184
+ return;
185
+ }
186
+ event.stopPropagation();
187
+ context.copyActiveValue();
188
+ }, type: "button", ...props, children: [_jsx(AnimatePresence, { initial: false, children: !context.copied && (_jsx(motion.span, { animate: {
189
+ opacity: 1,
190
+ transform: "scale(1)",
191
+ filter: "blur(0px)",
192
+ }, className: "absolute inset-0 flex items-center justify-center", exit: {
193
+ opacity: 0,
194
+ transform: "scale(0.5)",
195
+ filter: "blur(1px)",
196
+ }, initial: {
197
+ opacity: 0,
198
+ transform: "scale(0.5)",
199
+ filter: "blur(1px)",
200
+ }, transition: shouldReduceMotion
201
+ ? { duration: 0 }
202
+ : { duration: 0.2, ease: [0.23, 1, 0.32, 1] }, children: _jsx(IconCopy, { className: "block", size: 16 }) }, "copy")) }), _jsx(AnimatePresence, { initial: false, children: context.copied && (_jsx(motion.span, { animate: {
203
+ opacity: 1,
204
+ transform: "scale(1)",
205
+ filter: "blur(0px)",
206
+ }, className: "absolute inset-0 flex items-center justify-center", exit: {
207
+ opacity: 0,
208
+ transform: "scale(0.5)",
209
+ filter: "blur(1px)",
210
+ }, initial: {
211
+ opacity: 0,
212
+ transform: "scale(0.5)",
213
+ filter: "blur(1px)",
214
+ }, transition: shouldReduceMotion
215
+ ? { duration: 0 }
216
+ : { duration: 0.2, ease: [0.23, 1, 0.32, 1] }, children: _jsx(IconCheck, { className: "block", size: 16 }) }, "check")) })] }));
217
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"controls.d.ts","sourceRoot":"","sources":["../src/controls.tsx"],"names":[],"mappings":"AAYA,OAAO,EAAE,KAAK,cAAc,EAAuB,MAAM,OAAO,CAAC;AAGjE,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAS9C,UAAU,iBAAiB;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,eAAO,MAAM,YAAY,GAAI,wBAAwB,iBAAiB,4CAqBrE,CAAC;AAEF,eAAO,MAAM,WAAW,+CA4BvB,CAAC;AAEF,eAAO,MAAM,gBAAgB,sDA+B5B,CAAC;AAEF,KAAK,gBAAgB,GAAG,IAAI,CAAC,cAAc,CAAC,OAAO,MAAM,CAAC,EAAE,SAAS,CAAC,GAAG;IACvE,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,0DAOzB,gBAAgB,mDAgClB,CAAC"}
1
+ {"version":3,"file":"controls.d.ts","sourceRoot":"","sources":["../src/controls.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,cAAc,EAAuB,MAAM,OAAO,CAAC;AAGjE,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAS9C,UAAU,iBAAiB;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACtB;AAED,eAAO,MAAM,YAAY,GAAI,wBAAwB,iBAAiB,4CAqBrE,CAAC;AAEF,eAAO,MAAM,WAAW,+CA4BvB,CAAC;AAEF,eAAO,MAAM,gBAAgB,sDA+B5B,CAAC;AAEF,KAAK,gBAAgB,GAAG,IAAI,CAAC,cAAc,CAAC,OAAO,MAAM,CAAC,EAAE,SAAS,CAAC,GAAG;IACvE,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,0DAOzB,gBAAgB,mDA2BlB,CAAC"}
package/dist/controls.js CHANGED
@@ -1,8 +1,8 @@
1
1
  "use client";
2
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { useI18n } from "fumadocs-ui/contexts/i18n";
4
4
  import { useSearchContext } from "fumadocs-ui/contexts/search";
5
- import { CheckIcon, LanguagesIcon, MessagesSquareIcon, MoonIcon, SunIcon, } from "lucide-react";
5
+ import { CheckIcon, LanguagesIcon, MoonIcon, SunIcon } from "lucide-react";
6
6
  import { useTheme } from "next-themes";
7
7
  import { useEffect, useState } from "react";
8
8
  import { useGeistdocsChat } from "./internal/chat/context";
@@ -48,5 +48,5 @@ export const AskAIButton = ({ children, className, prompt, size = "sm", variant
48
48
  return;
49
49
  }
50
50
  setIsOpen(!isOpen);
51
- }, size: size, type: "button", variant: variant, ...props, children: children ?? (_jsxs(_Fragment, { children: [_jsx(MessagesSquareIcon, { className: "size-3.5 text-gray-800" }), _jsx("span", { children: "Ask AI" })] })) }));
51
+ }, size: size, type: "button", variant: variant, ...props, children: children ?? _jsx("span", { children: "Ask AI" }) }));
52
52
  };
package/dist/versions.js CHANGED
@@ -66,7 +66,7 @@ export const GeistdocsRouteSelect = ({ ariaLabel = "Select route", className, cu
66
66
  const currentDescription = currentItem
67
67
  ? getDescription({ active: true, item: currentItem })
68
68
  : null;
69
- return (_jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsxs("button", { "aria-label": ariaLabel, className: cn("group flex w-full items-center gap-3 rounded-xl px-2 py-2 text-left outline-none transition-colors hover:bg-gray-100 focus-visible:ring-2 focus-visible:ring-blue-700", className), type: "button", children: [currentItem ? renderIcon({ active: true, item: currentItem }) : null, _jsxs("span", { className: "min-w-0 flex-1", children: [_jsx("span", { className: "block truncate font-medium text-gray-1000 text-sm leading-5", children: currentItem?.label ?? currentId }), currentDescription ? (_jsx("span", { className: "block truncate text-gray-800 text-sm leading-5", children: currentDescription })) : null] }), _jsx(ChevronDownIcon, { className: "size-4 shrink-0 text-gray-900 transition-transform group-data-[state=open]:rotate-180" })] }) }), _jsx(DropdownMenuContent, { align: "start", className: "w-(--radix-dropdown-menu-trigger-width) min-w-64 rounded-xl border border-gray-alpha-400 bg-background-100 p-1 shadow-(--ds-shadow-menu)", children: items.map((item) => {
69
+ return (_jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsxs("button", { "aria-label": ariaLabel, className: cn("group flex w-full items-center gap-3 rounded-xl px-2 py-2 text-left outline-none transition-colors hover:bg-gray-100 focus-visible:ring-2 focus-visible:ring-blue-700", className), type: "button", children: [currentItem ? renderIcon({ active: true, item: currentItem }) : null, _jsxs("span", { className: "min-w-0 flex-1", children: [_jsx("span", { className: "block truncate font-medium text-gray-1000 text-sm leading-5", children: currentItem?.label ?? currentId }), currentDescription ? (_jsx("span", { className: "block truncate text-gray-800 text-sm leading-5", children: currentDescription })) : null] }), _jsx(ChevronDownIcon, { className: "size-4 shrink-0 text-gray-900 transition-transform group-data-[state=open]:rotate-180" })] }) }), _jsx(DropdownMenuContent, { align: "start", className: "w-(--radix-dropdown-menu-trigger-width) min-w-64 rounded-xl bg-background-100 p-1 shadow-(--ds-shadow-menu)", children: items.map((item) => {
70
70
  const active = item.id === currentId;
71
71
  const description = getDescription({ active, item });
72
72
  return (_jsxs(DropdownMenuItem, { className: "flex cursor-pointer items-center gap-3 rounded-lg px-2 py-2", onSelect: () => navigateToItem(item), children: [renderIcon({ active, item }), _jsxs("span", { className: "min-w-0 flex-1", children: [_jsx("span", { className: "block truncate font-medium text-gray-1000 text-sm leading-5", children: item.label }), description ? (_jsx("span", { className: "block truncate text-gray-800 text-sm leading-5", children: description })) : null] }), active ? _jsx(CheckIcon, { className: "size-4 text-blue-900" }) : null] }, item.id));
package/docs/agents.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Geistdocs Package Docs
2
2
 
3
- These docs are bundled with `@vercel/geistdocs` 1.4.1 so agents can understand the installed package without web access.
3
+ These docs are bundled with `@vercel/geistdocs` 1.6.0 so agents can understand the installed package without web access.
4
4
  They are generated from `apps/template/content/docs` during the package build.
5
5
 
6
6
  ## How to use these files
package/docs/llms.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  # Geistdocs Package Documentation
2
2
 
3
- These docs are bundled with `@vercel/geistdocs` 1.4.1.
3
+ These docs are bundled with `@vercel/geistdocs` 1.6.0.
4
4
  They describe how to build package-backed Geistdocs sites and how to use the package APIs from generated project adapters.
5
5
 
6
6
  ## Documentation Index
@@ -1232,6 +1232,32 @@ export const Button = ({ children }) => {
1232
1232
  };
1233
1233
  ```
1234
1234
 
1235
+ ### Framework icons
1236
+
1237
+ Append `#<framework>` to the title to show a framework logo instead of the
1238
+ language icon. The suffix is stripped from the displayed title. Supported
1239
+ values are `#next` / `#nextjs` and `#svelte` / `#sveltekit`:
1240
+
1241
+ ````md
1242
+ ```ts title="flags.ts#next"
1243
+ import { flag } from 'flags/next';
1244
+ ```
1245
+
1246
+ ```ts title="flags.ts#svelte"
1247
+ import { flag } from 'flags/sveltekit';
1248
+ ```
1249
+ ````
1250
+
1251
+ This renders as:
1252
+
1253
+ ```ts title="flags.ts#next"
1254
+ import { flag } from 'flags/next';
1255
+ ```
1256
+
1257
+ ```ts title="flags.ts#svelte"
1258
+ import { flag } from 'flags/sveltekit';
1259
+ ```
1260
+
1235
1261
  ### Line Numbers
1236
1262
 
1237
1263
  Display line numbers by adding the `lineNumbers` attribute:
@@ -190,5 +190,5 @@
190
190
  }
191
191
  ],
192
192
  "source": "apps/template/content/docs",
193
- "version": "1.4.1"
193
+ "version": "1.6.0"
194
194
  }
@@ -194,6 +194,32 @@ export const Button = ({ children }) => {
194
194
  };
195
195
  ```
196
196
 
197
+ ### Framework icons
198
+
199
+ Append `#<framework>` to the title to show a framework logo instead of the
200
+ language icon. The suffix is stripped from the displayed title. Supported
201
+ values are `#next` / `#nextjs` and `#svelte` / `#sveltekit`:
202
+
203
+ ````md
204
+ ```ts title="flags.ts#next"
205
+ import { flag } from 'flags/next';
206
+ ```
207
+
208
+ ```ts title="flags.ts#svelte"
209
+ import { flag } from 'flags/sveltekit';
210
+ ```
211
+ ````
212
+
213
+ This renders as:
214
+
215
+ ```ts title="flags.ts#next"
216
+ import { flag } from 'flags/next';
217
+ ```
218
+
219
+ ```ts title="flags.ts#svelte"
220
+ import { flag } from 'flags/sveltekit';
221
+ ```
222
+
197
223
  ### Line Numbers
198
224
 
199
225
  Display line numbers by adding the `lineNumbers` attribute:
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vercel/geistdocs",
3
3
  "description": "Runtime and CLI for Geistdocs projects.",
4
- "version": "1.4.1",
4
+ "version": "1.6.0",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/vercel/geistdocs",
@@ -111,6 +111,10 @@
111
111
  "types": "./dist/shiki-theme.d.ts",
112
112
  "default": "./dist/shiki-theme.js"
113
113
  },
114
+ "./components/badge": {
115
+ "types": "./dist/components/badge.d.ts",
116
+ "default": "./dist/components/badge.js"
117
+ },
114
118
  "./components/button": {
115
119
  "types": "./dist/components/button.d.ts",
116
120
  "default": "./dist/components/button.js"
@@ -139,6 +143,10 @@
139
143
  "types": "./dist/components/collapsible.d.ts",
140
144
  "default": "./dist/components/collapsible.js"
141
145
  },
146
+ "./components/command-prompt": {
147
+ "types": "./dist/components/command-prompt.d.ts",
148
+ "default": "./dist/components/command-prompt.js"
149
+ },
142
150
  "./components/copy-prompt": {
143
151
  "types": "./dist/components/copy-prompt.d.ts",
144
152
  "default": "./dist/components/copy-prompt.js"
@@ -1,5 +1,5 @@
1
+ import { Badge } from "@vercel/geistdocs/components/badge";
1
2
  import type { ReactNode } from "react";
2
- import { Badge } from "@/components/ui/badge";
3
3
 
4
4
  interface HeroProps {
5
5
  badge: string;
@@ -1,4 +1,3 @@
1
- import type { Metadata } from "next";
2
1
  import {
3
2
  CommandPromptContent,
4
3
  CommandPromptCopy,
@@ -9,7 +8,8 @@ import {
9
8
  CommandPromptTrigger,
10
9
  CommandPromptTriggerDivider,
11
10
  CommandPromptViewport,
12
- } from "@/components/ui/command-prompt";
11
+ } from "@vercel/geistdocs/components/command-prompt";
12
+ import type { Metadata } from "next";
13
13
  import { CenteredSection } from "./components/centered-section";
14
14
  import { CTA } from "./components/cta";
15
15
  import { Hero } from "./components/hero";
@@ -192,6 +192,32 @@ export const Button = ({ children }) => {
192
192
  };
193
193
  ```
194
194
 
195
+ ### Framework icons
196
+
197
+ Append `#<framework>` to the title to show a framework logo instead of the
198
+ language icon. The suffix is stripped from the displayed title. Supported
199
+ values are `#next` / `#nextjs` and `#svelte` / `#sveltekit`:
200
+
201
+ ````md
202
+ ```ts title="flags.ts#next"
203
+ import { flag } from 'flags/next';
204
+ ```
205
+
206
+ ```ts title="flags.ts#svelte"
207
+ import { flag } from 'flags/sveltekit';
208
+ ```
209
+ ````
210
+
211
+ This renders as:
212
+
213
+ ```ts title="flags.ts#next"
214
+ import { flag } from 'flags/next';
215
+ ```
216
+
217
+ ```ts title="flags.ts#svelte"
218
+ import { flag } from 'flags/sveltekit';
219
+ ```
220
+
195
221
  ### Line Numbers
196
222
 
197
223
  Display line numbers by adding the `lineNumbers` attribute:
@@ -18,7 +18,7 @@
18
18
  "@streamdown/code": "^1.0.1",
19
19
  "@vercel/agent-readability": "^0.2.1",
20
20
  "@vercel/analytics": "^1.6.1",
21
- "@vercel/geistdocs": "1.4.1",
21
+ "@vercel/geistdocs": "1.6.0",
22
22
  "@vercel/speed-insights": "^1.3.1",
23
23
  "ai": "^6.0.132",
24
24
  "class-variance-authority": "^0.7.1",
@@ -1,46 +0,0 @@
1
- import * as React from "react"
2
- import { Slot as SlotPrimitive } from "radix-ui"
3
- import { cva, type VariantProps } from "class-variance-authority"
4
-
5
- import { cn } from "@/lib/utils"
6
-
7
- const badgeVariants = cva(
8
- "inline-flex items-center justify-center rounded-full border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-gray-600 focus-visible:ring-gray-600/50 focus-visible:ring-[3px] aria-invalid:ring-red-800/20 dark:aria-invalid:ring-red-800/40 aria-invalid:border-red-800 transition-[color,box-shadow] overflow-hidden",
9
- {
10
- variants: {
11
- variant: {
12
- default:
13
- "border-transparent bg-gray-1000 text-background-100 [a&]:hover:bg-gray-1000/90",
14
- secondary:
15
- "border-transparent bg-gray-alpha-400 text-gray-1000 [a&]:hover:bg-gray-alpha-400/90",
16
- destructive:
17
- "border-transparent bg-red-800 text-white [a&]:hover:bg-red-800/90 focus-visible:ring-red-800/20 dark:focus-visible:ring-red-800/40 dark:bg-red-800/60",
18
- outline:
19
- "text-gray-1000 [a&]:hover:bg-gray-100 [a&]:hover:text-gray-1000",
20
- },
21
- },
22
- defaultVariants: {
23
- variant: "default",
24
- },
25
- }
26
- )
27
-
28
- function Badge({
29
- className,
30
- variant,
31
- asChild = false,
32
- ...props
33
- }: React.ComponentProps<"span"> &
34
- VariantProps<typeof badgeVariants> & { asChild?: boolean }) {
35
- const Comp = asChild ? SlotPrimitive.Slot : "span"
36
-
37
- return (
38
- <Comp
39
- data-slot="badge"
40
- className={cn(badgeVariants({ variant }), className)}
41
- {...props}
42
- />
43
- )
44
- }
45
-
46
- export { Badge, badgeVariants }