@vercel/geistdocs 2.6.0 → 2.7.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.
- package/dist/cli/index.js +1 -1
- package/dist/internal/github-button.d.ts.map +1 -1
- package/dist/internal/github-button.js +2 -1
- package/dist/internal/mdx-to-markdown.d.ts.map +1 -1
- package/dist/internal/mdx-to-markdown.js +465 -27
- package/dist/providers/public/components/badge.d.ts +13 -6
- package/dist/providers/public/components/badge.d.ts.map +1 -1
- package/dist/providers/public/components/badge.js +54 -9
- package/dist/providers/public/components/code-block-server.d.ts.map +1 -1
- package/dist/providers/public/components/code-block-server.js +13 -3
- package/dist/providers/public/components/filename-icon.d.ts +3 -0
- package/dist/providers/public/components/filename-icon.d.ts.map +1 -0
- package/dist/providers/public/components/filename-icon.js +13 -0
- package/dist/providers/public/components/input.d.ts +27 -0
- package/dist/providers/public/components/input.d.ts.map +1 -0
- package/dist/providers/public/components/input.js +27 -0
- package/dist/providers/public/components/theme-switcher.d.ts +5 -1
- package/dist/providers/public/components/theme-switcher.d.ts.map +1 -1
- package/dist/providers/public/components/theme-switcher.js +7 -3
- package/dist/providers/public/components/toggle.d.ts +26 -0
- package/dist/providers/public/components/toggle.d.ts.map +1 -0
- package/dist/providers/public/components/toggle.js +53 -0
- package/dist/providers/public/components/tooltip.d.ts +33 -7
- package/dist/providers/public/components/tooltip.d.ts.map +1 -1
- package/dist/providers/public/components/tooltip.js +19 -1
- package/dist/providers/public-assets/icons.d.ts +1 -0
- package/dist/providers/public-assets/icons.d.ts.map +1 -1
- package/dist/providers/public-assets/icons.js +1 -0
- package/docs/agents.md +25 -2
- package/docs/llms.txt +975 -14
- package/docs/manifest.json +211 -4
- package/docs/pages/components/badge.md +30 -0
- package/docs/pages/components/button.md +28 -0
- package/docs/pages/components/callout.md +28 -0
- package/docs/pages/components/code-block-tabs.md +49 -0
- package/docs/pages/components/code-block.md +26 -0
- package/docs/pages/components/collapsible.md +38 -0
- package/docs/pages/components/command-prompt.md +59 -0
- package/docs/pages/components/copy-prompt.md +25 -0
- package/docs/pages/components/details.md +37 -0
- package/docs/pages/components/dropdown-menu.md +43 -0
- package/docs/pages/components/image.md +36 -0
- package/docs/pages/components/index.md +49 -0
- package/docs/pages/components/input.md +35 -0
- package/docs/pages/components/link.md +28 -0
- package/docs/pages/components/mermaid.md +29 -0
- package/docs/pages/components/navigation-menu.md +50 -0
- package/docs/pages/components/popover.md +38 -0
- package/docs/pages/components/scroll-area.md +40 -0
- package/docs/pages/components/tabs.md +47 -0
- package/docs/pages/components/theme-switcher.md +32 -0
- package/docs/pages/components/toggle.md +37 -0
- package/docs/pages/components/tooltip.md +36 -0
- package/docs/pages/components/video.md +26 -0
- package/docs/pages/index.md +1 -1
- package/docs/pages/migration.md +4 -4
- package/docs/pages/syntax.md +7 -7
- package/docs/sitemap.md +24 -1
- package/package.json +29 -1
- package/public-foundation.css +1 -1
- package/template/components/geistdocs/toggle-demo.tsx +14 -0
- package/template/content/docs/components/badge.mdx +26 -0
- package/template/content/docs/components/button.mdx +24 -0
- package/template/content/docs/components/callout.mdx +24 -0
- package/template/content/docs/components/code-block-tabs.mdx +45 -0
- package/template/content/docs/components/code-block.mdx +22 -0
- package/template/content/docs/components/collapsible.mdx +34 -0
- package/template/content/docs/components/command-prompt.mdx +55 -0
- package/template/content/docs/components/copy-prompt.mdx +23 -0
- package/template/content/docs/components/details.mdx +33 -0
- package/template/content/docs/components/dropdown-menu.mdx +39 -0
- package/template/content/docs/components/image.mdx +32 -0
- package/template/content/docs/components/index.mdx +45 -0
- package/template/content/docs/components/input.mdx +31 -0
- package/template/content/docs/components/link.mdx +24 -0
- package/template/content/docs/components/mermaid.mdx +25 -0
- package/template/content/docs/components/meta.json +25 -1
- package/template/content/docs/components/navigation-menu.mdx +46 -0
- package/template/content/docs/components/popover.mdx +34 -0
- package/template/content/docs/components/scroll-area.mdx +36 -0
- package/template/content/docs/components/tabs.mdx +43 -0
- package/template/content/docs/components/theme-switcher.mdx +28 -0
- package/template/content/docs/components/toggle.mdx +33 -0
- package/template/content/docs/components/tooltip.mdx +32 -0
- package/template/content/docs/components/video.mdx +22 -0
- package/template/content/docs/index.mdx +1 -1
- package/template/content/docs/meta.json +1 -1
- package/template/content/docs/migration.mdx +4 -4
- package/template/content/docs/syntax.cn.mdx +3 -3
- package/template/content/docs/syntax.mdx +7 -7
- package/template/package.json +1 -1
|
@@ -1,8 +1,15 @@
|
|
|
1
|
-
import type
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { type VariantProps } from "class-variance-authority";
|
|
2
|
+
import { type HTMLAttributes, type ReactNode } from "react";
|
|
3
|
+
export declare const badgeVariants: (props?: ({
|
|
4
|
+
contrast?: "high" | "low" | null | undefined;
|
|
5
|
+
numerical?: boolean | null | undefined;
|
|
6
|
+
size?: "md" | "lg" | "sm" | null | undefined;
|
|
7
|
+
variant?: "red" | "blue" | "amber" | "green" | "teal" | "purple" | "pink" | "gray" | "inverted" | "pill" | "trial" | "turbo" | null | undefined;
|
|
8
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
9
|
+
export type BadgeVariant = NonNullable<VariantProps<typeof badgeVariants>["variant"]>;
|
|
10
|
+
export interface BadgeProps extends HTMLAttributes<HTMLDivElement>, VariantProps<typeof badgeVariants> {
|
|
11
|
+
asChild?: boolean;
|
|
12
|
+
icon?: ReactNode;
|
|
5
13
|
}
|
|
6
|
-
export declare
|
|
7
|
-
export {};
|
|
14
|
+
export declare function Badge({ asChild, children, className, contrast, icon, numerical, size, variant, ...props }: BadgeProps): import("react/jsx-runtime").JSX.Element;
|
|
8
15
|
//# sourceMappingURL=badge.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"badge.d.ts","sourceRoot":"","sources":["../../../../src/providers/public/components/badge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"badge.d.ts","sourceRoot":"","sources":["../../../../src/providers/public/components/badge.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAElE,OAAO,EAEL,KAAK,cAAc,EAEnB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAGf,eAAO,MAAM,aAAa;;;;;8EAuCzB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG,WAAW,CACpC,YAAY,CAAC,OAAO,aAAa,CAAC,CAAC,SAAS,CAAC,CAC9C,CAAC;AAEF,MAAM,WAAW,UACf,SAAQ,cAAc,CAAC,cAAc,CAAC,EACpC,YAAY,CAAC,OAAO,aAAa,CAAC;IACpC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,SAAS,CAAC;CAClB;AAED,wBAAgB,KAAK,CAAC,EACpB,OAAO,EACP,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,IAAI,EACJ,SAAS,EACT,IAAI,EACJ,OAAO,EACP,GAAG,KAAK,EACT,EAAE,UAAU,2CA+BZ"}
|
|
@@ -1,10 +1,55 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cva } from "class-variance-authority";
|
|
3
|
+
import { Slot as SlotPrimitive } from "radix-ui";
|
|
4
|
+
import { cloneElement, isValidElement, } from "react";
|
|
2
5
|
import { cn } from "../utils";
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
|
|
6
|
+
export const badgeVariants = cva("inline-flex w-fit shrink-0 items-center justify-center whitespace-nowrap rounded-full font-medium tabular-nums", {
|
|
7
|
+
defaultVariants: {
|
|
8
|
+
contrast: "high",
|
|
9
|
+
numerical: false,
|
|
10
|
+
size: "md",
|
|
11
|
+
variant: "gray",
|
|
12
|
+
},
|
|
13
|
+
variants: {
|
|
14
|
+
contrast: {
|
|
15
|
+
high: null,
|
|
16
|
+
low: "opacity-90",
|
|
17
|
+
},
|
|
18
|
+
numerical: {
|
|
19
|
+
false: null,
|
|
20
|
+
true: "min-w-6",
|
|
21
|
+
},
|
|
22
|
+
size: {
|
|
23
|
+
lg: "h-8 gap-1.5 px-3 text-sm [&_[data-slot=icon]]:size-4",
|
|
24
|
+
md: "h-6 gap-1.25 px-3 text-[12px]/[24px] [&_[data-slot=icon]]:size-3.5",
|
|
25
|
+
sm: "h-5 gap-1 px-2 text-[11px]/[20px] [&_[data-slot=icon]]:size-3",
|
|
26
|
+
},
|
|
27
|
+
variant: {
|
|
28
|
+
amber: "bg-amber-200 text-amber-1000",
|
|
29
|
+
blue: "bg-blue-200 text-blue-1000",
|
|
30
|
+
gray: "bg-gray-alpha-400 text-gray-1000",
|
|
31
|
+
green: "bg-green-200 text-green-1000",
|
|
32
|
+
inverted: "bg-gray-1000 text-background-100",
|
|
33
|
+
pill: "bg-background-100 text-gray-1000 ring-1 ring-gray-alpha-400 ring-inset",
|
|
34
|
+
pink: "bg-pink-200 text-pink-1000",
|
|
35
|
+
purple: "bg-purple-200 text-purple-1000",
|
|
36
|
+
red: "bg-red-200 text-red-1000",
|
|
37
|
+
teal: "bg-teal-200 text-teal-1000",
|
|
38
|
+
trial: "bg-linear-[135deg,rgb(0,112,243),rgb(248,28,229)] text-white",
|
|
39
|
+
turbo: "bg-linear-[135deg,rgb(255,30,86),rgb(0,150,255)] text-white",
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
});
|
|
43
|
+
export function Badge({ asChild, children, className, contrast, icon, numerical, size, variant, ...props }) {
|
|
44
|
+
const iconElement = icon && isValidElement(icon)
|
|
45
|
+
? cloneElement(icon, {
|
|
46
|
+
className: cn("relative shrink-0", icon.props.className),
|
|
47
|
+
"data-slot": "icon",
|
|
48
|
+
})
|
|
49
|
+
: null;
|
|
50
|
+
const classes = cn(badgeVariants({ contrast, numerical, size, variant }), className);
|
|
51
|
+
if (asChild) {
|
|
52
|
+
return (_jsx(SlotPrimitive.Root, { className: classes, ...props, children: children }));
|
|
53
|
+
}
|
|
54
|
+
return (_jsxs("div", { className: classes, ...props, children: [iconElement, children === null || children === undefined ? null : (_jsx("span", { className: "relative inline-flex min-w-0 items-center gap-[inherit]", children: children }))] }));
|
|
55
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"code-block-server.d.ts","sourceRoot":"","sources":["../../../../src/providers/public/components/code-block-server.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA4B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"code-block-server.d.ts","sourceRoot":"","sources":["../../../../src/providers/public/components/code-block-server.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA4B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAMjE,UAAU,oBAAoB;IAC5B,QAAQ,EAAE,SAAS,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,SAAS,CAAC;IAC1B,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AA8BD,eAAO,MAAM,eAAe,GAAI,mDAK7B,oBAAoB,4CAkEtB,CAAC"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Children, isValidElement } from "react";
|
|
3
|
-
import { IconFile, IconTerminal } from "#geistdocs-assets/icons";
|
|
3
|
+
import { IconAcronymTs, IconFile, IconTerminal } from "#geistdocs-assets/icons";
|
|
4
4
|
import { cn } from "../utils";
|
|
5
5
|
import { CopyButton } from "./copy-button";
|
|
6
|
+
import { getFilenameIconKind } from "./filename-icon";
|
|
6
7
|
const extractText = (node) => {
|
|
7
8
|
let text = "";
|
|
8
9
|
Children.forEach(node, (child) => {
|
|
@@ -16,11 +17,20 @@ const extractText = (node) => {
|
|
|
16
17
|
});
|
|
17
18
|
return text;
|
|
18
19
|
};
|
|
19
|
-
const
|
|
20
|
+
const FilenameIcon = ({ filename }) => {
|
|
21
|
+
const kind = getFilenameIconKind(filename);
|
|
22
|
+
if (kind === "terminal") {
|
|
23
|
+
return _jsx(IconTerminal, { size: 16 });
|
|
24
|
+
}
|
|
25
|
+
if (kind === "typescript") {
|
|
26
|
+
return _jsx(IconAcronymTs, { size: 16 });
|
|
27
|
+
}
|
|
28
|
+
return _jsx(IconFile, { size: 16 });
|
|
29
|
+
};
|
|
20
30
|
export const CodeBlockServer = ({ children, className, filename, headerActions, }) => {
|
|
21
31
|
const hasHeader = Boolean(filename || headerActions);
|
|
22
32
|
const copyText = extractText(children);
|
|
23
|
-
return (_jsxs("div", { className: cn("group/copy relative my-4 overflow-hidden rounded-lg", className), "data-geist-code-block": "", children: [hasHeader ? (_jsxs("div", { className: "flex h-(--ds-size-large) items-center rounded-t-lg border border-gray-400 bg-background-200 py-0 pr-[5px] pl-4", "data-section": "tabs", children: [filename ? (_jsxs("div", { className: "mr-auto flex min-w-0 items-center gap-2 text-gray-900 text-label-13", children: [_jsx("span", { "aria-hidden": true, className: "flex w-4 shrink-0 items-center", children:
|
|
33
|
+
return (_jsxs("div", { className: cn("group/copy relative my-4 overflow-hidden rounded-lg", className), "data-geist-code-block": "", children: [hasHeader ? (_jsxs("div", { className: "flex h-(--ds-size-large) items-center rounded-t-lg border border-gray-400 bg-background-200 py-0 pr-[5px] pl-4", "data-section": "tabs", children: [filename ? (_jsxs("div", { className: "mr-auto flex min-w-0 items-center gap-2 text-gray-900 text-label-13", children: [_jsx("span", { "aria-hidden": true, className: "flex w-4 shrink-0 items-center", children: _jsx(FilenameIcon, { filename: filename }) }), _jsx("span", { className: "inline-block min-w-0 max-w-full truncate break-normal", children: filename })] })) : null, _jsxs("div", { className: cn("flex gap-1", headerActions && "min-w-0 grow items-center"), children: [headerActions, _jsx(CopyButton, { className: "size-7", text: copyText })] })] })) : (_jsx(CopyButton, { className: "absolute top-[min(16%,16px)] right-4 z-1 size-8 bg-background-200 opacity-0 shadow-[var(--ds-shadow-border)] focus:opacity-100 group-hover/copy:opacity-100", text: copyText })), _jsx("div", { className: cn("border-gray-400 border-x border-b", "rounded-b-lg [&>pre]:rounded-b-lg", !hasHeader && "rounded-t-lg border-t [&>pre]:rounded-t-lg"), "data-section": "content", children: _jsx("pre", { className: "m-0 overflow-x-auto bg-background-100 py-4 [scrollbar-color:var(--ds-gray-600)_transparent] [scrollbar-width:thin]",
|
|
24
34
|
// biome-ignore lint/a11y/noNoninteractiveTabindex: axe requires horizontally scrollable code regions to be keyboard-focusable.
|
|
25
35
|
tabIndex: 0, children: _jsx("code", { className: "grid min-w-full hyphens-none whitespace-pre break-normal text-left font-mono text-[13px]! text-gray-1000 leading-5 [&:not(:has(.line,.highlighted-line))]:px-5", style: { fontFeatureSettings: '"liga" off' }, children: children }) }) })] }));
|
|
26
36
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filename-icon.d.ts","sourceRoot":"","sources":["../../../../src/providers/public/components/filename-icon.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,UAAU,GAAG,YAAY,CAAC;AAKlE,eAAO,MAAM,mBAAmB,GAAI,UAAU,MAAM,KAAG,gBAYtD,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
const TERMINAL_NAMES = new Set(["bash", "shell", "sh", "terminal"]);
|
|
2
|
+
const TYPESCRIPT_EXTENSIONS = new Set(["cts", "mts", "ts", "tsx"]);
|
|
3
|
+
export const getFilenameIconKind = (filename) => {
|
|
4
|
+
const normalizedFilename = filename.toLowerCase();
|
|
5
|
+
if (TERMINAL_NAMES.has(normalizedFilename)) {
|
|
6
|
+
return "terminal";
|
|
7
|
+
}
|
|
8
|
+
const extension = normalizedFilename.split(".").pop() ?? "";
|
|
9
|
+
if (TYPESCRIPT_EXTENSIONS.has(extension)) {
|
|
10
|
+
return "typescript";
|
|
11
|
+
}
|
|
12
|
+
return "file";
|
|
13
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type ComponentPropsWithoutRef, type CSSProperties, type HTMLInputTypeAttribute, type ReactNode } from "react";
|
|
2
|
+
type NativeInputProps = Omit<ComponentPropsWithoutRef<"input">, "prefix" | "size" | "type">;
|
|
3
|
+
export interface InputProps extends NativeInputProps {
|
|
4
|
+
bypassCasing?: boolean;
|
|
5
|
+
"data-testid"?: string;
|
|
6
|
+
error?: ReactNode;
|
|
7
|
+
explicitId?: string;
|
|
8
|
+
innerWrapperClassName?: string;
|
|
9
|
+
keyboardFocus?: boolean;
|
|
10
|
+
label?: ReactNode;
|
|
11
|
+
prefix?: ReactNode;
|
|
12
|
+
prefixContainer?: boolean;
|
|
13
|
+
prefixStyling?: boolean;
|
|
14
|
+
rounded?: boolean;
|
|
15
|
+
showErrorMessage?: boolean;
|
|
16
|
+
size?: "small" | "medium" | "large";
|
|
17
|
+
suffix?: ReactNode;
|
|
18
|
+
suffixContainer?: boolean;
|
|
19
|
+
suffixStyling?: boolean;
|
|
20
|
+
type?: "alert" | "cyan" | "default" | "error" | "ghost" | "lite" | "rotate-ccw" | "secondary" | "success" | "tertiary" | "violet" | "warning";
|
|
21
|
+
typeName?: HTMLInputTypeAttribute;
|
|
22
|
+
width?: CSSProperties["width"];
|
|
23
|
+
wrapperClassName?: string;
|
|
24
|
+
}
|
|
25
|
+
export declare const Input: import("react").ForwardRefExoticComponent<InputProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
26
|
+
export {};
|
|
27
|
+
//# sourceMappingURL=input.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../../../src/providers/public/components/input.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,wBAAwB,EAC7B,KAAK,aAAa,EAElB,KAAK,sBAAsB,EAC3B,KA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runtime";
|
|
3
|
+
import { forwardRef, } from "react";
|
|
4
|
+
import { cn } from "../utils";
|
|
5
|
+
const SIZE_CLASSES = {
|
|
6
|
+
large: "h-(--ds-size-large) px-3 text-base",
|
|
7
|
+
medium: "h-9 px-3 py-1 text-base md:text-sm",
|
|
8
|
+
small: "h-8 px-3 text-sm",
|
|
9
|
+
};
|
|
10
|
+
export const Input = forwardRef(function Input({ className, autoCapitalize = "none", autoComplete = "off", autoCorrect = "off", bypassCasing, disabled, error, explicitId, id, innerWrapperClassName, keyboardFocus, label, prefix, prefixContainer = true, prefixStyling = true, rounded, showErrorMessage = true, size = "medium", suffix, suffixContainer = true, suffixStyling = true, type, typeName = "text", width, wrapperClassName, spellCheck = false, ...props }, ref) {
|
|
11
|
+
const inputId = explicitId ?? id;
|
|
12
|
+
const errorId = inputId ? `${inputId}-error` : undefined;
|
|
13
|
+
let radiusClass = size === "large" ? "rounded-lg" : "rounded-md";
|
|
14
|
+
if (rounded) {
|
|
15
|
+
radiusClass = "rounded-full";
|
|
16
|
+
}
|
|
17
|
+
const adornment = (content, position, useContainer, useStyling) => {
|
|
18
|
+
if (!content) {
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
21
|
+
const Component = useContainer ? "label" : "span";
|
|
22
|
+
return (_jsx(Component, { "aria-hidden": true, className: cn("flex shrink-0 items-center text-gray-700 [&>svg]:size-(--ds-control-decoration-size)", useStyling && "bg-background-200 px-3", position === "prefix" && "order-0", position === "suffix" && "order-2", position === "prefix" && useStyling && "border-gray-400 border-r", position === "suffix" && useStyling && "border-gray-400 border-l"), "data-geist-input-adornment": position, ...(useContainer ? { htmlFor: inputId } : {}), children: content }));
|
|
23
|
+
};
|
|
24
|
+
return (_jsxs("div", { className: cn("flex flex-col gap-2", wrapperClassName), style: { width }, children: [label ? (_jsx("label", { className: cn("text-gray-1000 text-label-13", !bypassCasing && "capitalize"), htmlFor: inputId, children: label })) : null, _jsxs("div", { className: cn("flex max-w-full overflow-hidden bg-background-100 font-normal shadow-[0_0_0_1px_var(--ds-gray-alpha-400)] transition-all duration-150", error
|
|
25
|
+
? "shadow-[0_0_0_1px_var(--ds-red-900),0_0_0_4px_var(--ds-red-300)] hover:shadow-[0_0_0_1px_var(--ds-red-900),0_0_0_4px_var(--ds-red-500)] has-[:focus]:shadow-[0_0_0_1px_var(--ds-red-900),0_0_0_4px_var(--ds-red-300)]"
|
|
26
|
+
: "has-[:focus]:!shadow-[0_0_0_1px_var(--ds-gray-alpha-600),0_0_0_4px_rgba(0,0,0,0.16)] dark-theme:has-[:focus]:!shadow-[0_0_0_1px_var(--ds-gray-alpha-600),0_0_0_4px_rgba(255,255,255,0.24)] hover:shadow-[0_0_0_1px_var(--ds-gray-alpha-500)] hover:[&:has(input:disabled)]:shadow-[0_0_0_1px_var(--ds-gray-alpha-400)]", radiusClass, innerWrapperClassName, className), "data-geist-input-wrapper": "", "data-keyboard-focus": keyboardFocus ? "" : undefined, "data-type": type, children: [adornment(prefix, "prefix", prefixContainer, prefixStyling), _jsx("input", { ...props, "aria-describedby": error ? errorId : props["aria-describedby"], "aria-invalid": Boolean(error), autoCapitalize: autoCapitalize, autoComplete: autoComplete, autoCorrect: autoCorrect, className: cn("order-1 w-full min-w-0 flex-1 appearance-none rounded-md border-0 bg-transparent outline-none selection:bg-gray-1000 selection:text-background-100 file:inline-flex file:h-7 file:border-0 file:bg-transparent file:font-medium file:text-gray-1000 file:text-sm placeholder:text-gray-800 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 dark:bg-gray-alpha-400/30", prefix && "rounded-l-none", suffix && "rounded-r-none", SIZE_CLASSES[size], rounded && "rounded-full"), disabled: disabled, id: inputId, ref: ref, spellCheck: spellCheck, type: typeName }), adornment(suffix, "suffix", suffixContainer, suffixStyling)] }), showErrorMessage && error ? (_jsx("div", { className: "text-label-12 text-red-900", id: errorId, children: error })) : null] }));
|
|
27
|
+
});
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
interface ThemeSwitcherProps {
|
|
2
2
|
className?: string;
|
|
3
|
+
/** Disable every theme option. */
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
/** Called after a theme is selected. */
|
|
6
|
+
onThemeSwitch?: (theme: string) => void;
|
|
3
7
|
/** Compact variant with smaller segments. */
|
|
4
8
|
small?: boolean;
|
|
5
9
|
}
|
|
6
|
-
export declare const ThemeSwitcher: ({ className, small }: ThemeSwitcherProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
10
|
+
export declare const ThemeSwitcher: ({ className, disabled, onThemeSwitch, small, }: ThemeSwitcherProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
7
11
|
export {};
|
|
8
12
|
//# sourceMappingURL=theme-switcher.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme-switcher.d.ts","sourceRoot":"","sources":["../../../../src/providers/public/components/theme-switcher.tsx"],"names":[],"mappings":"AAoBA,UAAU,kBAAkB;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,6CAA6C;IAC7C,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAID,eAAO,MAAM,aAAa,GAAI,
|
|
1
|
+
{"version":3,"file":"theme-switcher.d.ts","sourceRoot":"","sources":["../../../../src/providers/public/components/theme-switcher.tsx"],"names":[],"mappings":"AAoBA,UAAU,kBAAkB;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kCAAkC;IAClC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,wCAAwC;IACxC,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,6CAA6C;IAC7C,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAID,eAAO,MAAM,aAAa,GAAI,gDAK3B,kBAAkB,mDAyDpB,CAAC"}
|
|
@@ -18,8 +18,8 @@ const THEMES = [
|
|
|
18
18
|
];
|
|
19
19
|
// Segmented system / light / dark theme control matching the vercel.com
|
|
20
20
|
// (geistcn) theme switcher.
|
|
21
|
-
export const ThemeSwitcher = ({ className, small }) => {
|
|
22
|
-
const { theme, setTheme } = useTheme();
|
|
21
|
+
export const ThemeSwitcher = ({ className, disabled, onThemeSwitch, small, }) => {
|
|
22
|
+
const { forcedTheme, theme, setTheme } = useTheme();
|
|
23
23
|
const rId = useId();
|
|
24
24
|
const [mounted, setMounted] = useState(false);
|
|
25
25
|
useEffect(() => {
|
|
@@ -29,9 +29,13 @@ export const ThemeSwitcher = ({ className, small }) => {
|
|
|
29
29
|
if (!mounted) {
|
|
30
30
|
return null;
|
|
31
31
|
}
|
|
32
|
+
const isDisabled = disabled || Boolean(forcedTheme);
|
|
32
33
|
return (_jsxs("fieldset", { className: cn("isolate m-0 flex h-8 w-fit rounded-full border-0 p-0 shadow-[var(--ds-shadow-border)] data-[small]:h-6", className), "data-small": small ? "" : undefined, children: [_jsx("legend", { className: "sr-only", children: "Select a display theme:" }), THEMES.map(({ Icon, SmallIcon, key }) => {
|
|
33
34
|
const Glyph = small ? SmallIcon : Icon;
|
|
34
35
|
const id = `theme-switch-${key}-${rId}`;
|
|
35
|
-
return (_jsxs("span", { className: "h-full", children: [_jsx("input", { "aria-label": key, checked: key === theme, className: "peer absolute m-0 appearance-none p-0 outline-none",
|
|
36
|
+
return (_jsxs("span", { className: "h-full", children: [_jsx("input", { "aria-label": key, checked: key === theme, className: "peer absolute m-0 appearance-none p-0 outline-none", disabled: isDisabled, id: id, onChange: () => {
|
|
37
|
+
setTheme(key);
|
|
38
|
+
onThemeSwitch?.(key);
|
|
39
|
+
}, type: "radio", value: key }), _jsxs("label", { className: "group relative m-0 flex size-8 cursor-pointer items-center justify-center rounded-full bg-none text-gray-700 hover:text-gray-1000 peer-checked:bg-background-100 peer-checked:text-gray-1000 peer-checked:shadow-[0_0_0_1px_var(--ds-gray-400),0px_1px_2px_0px_var(--ds-gray-alpha-100)] peer-focus-visible:text-gray-1000 peer-focus-visible:shadow-[var(--ds-focus-ring)] peer-disabled:cursor-not-allowed peer-disabled:text-gray-500 data-[small]:size-6", "data-small": small ? "" : undefined, htmlFor: id, children: [_jsx("span", { className: "sr-only", children: key }), _jsx("span", { className: "relative z-[1] size-4", children: _jsx(Glyph, {}) })] })] }, key));
|
|
36
40
|
})] }));
|
|
37
41
|
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { ComponentPropsWithoutRef, KeyboardEvent, ReactNode } from "react";
|
|
2
|
+
type NativeLabelProps = Omit<ComponentPropsWithoutRef<"label">, "color" | "onBlur" | "onChange" | "onClick" | "onFocus" | "onKeyDown" | "size">;
|
|
3
|
+
export interface ToggleProps extends NativeLabelProps {
|
|
4
|
+
checked: boolean;
|
|
5
|
+
color?: "amber" | "red" | "amber-inverted" | "amber-track-only";
|
|
6
|
+
"data-testid"?: string;
|
|
7
|
+
direction?: "label-first" | "switch-first";
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
icon?: {
|
|
10
|
+
checked: ReactNode;
|
|
11
|
+
unchecked: ReactNode;
|
|
12
|
+
};
|
|
13
|
+
labelCasing?: "title" | "normal";
|
|
14
|
+
name?: string;
|
|
15
|
+
noMargin?: boolean;
|
|
16
|
+
onBlur?: () => void;
|
|
17
|
+
onChange?: (checked: boolean) => void;
|
|
18
|
+
onClick?: () => void;
|
|
19
|
+
onFocus?: () => void;
|
|
20
|
+
onKeyDown?: (event: KeyboardEvent<HTMLInputElement>) => void;
|
|
21
|
+
size?: "medium" | "large";
|
|
22
|
+
stopPropagation?: boolean;
|
|
23
|
+
}
|
|
24
|
+
export declare const Toggle: ({ checked, children, className, color, "data-testid": dataTestId, direction, disabled, icon, labelCasing, name, noMargin, onBlur, onChange, onClick, onFocus, onKeyDown, size, stopPropagation, style, ...props }: ToggleProps) => import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
export {};
|
|
26
|
+
//# sourceMappingURL=toggle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toggle.d.ts","sourceRoot":"","sources":["../../../../src/provid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1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { cn } from "../utils";
|
|
4
|
+
const TRACK_SIZE_CLASSES = {
|
|
5
|
+
large: "h-6 w-10",
|
|
6
|
+
medium: "h-5 w-9",
|
|
7
|
+
small: "h-3.5 w-7",
|
|
8
|
+
};
|
|
9
|
+
const THUMB_SIZE_CLASSES = {
|
|
10
|
+
large: "size-5",
|
|
11
|
+
medium: "size-4",
|
|
12
|
+
small: "size-2.5",
|
|
13
|
+
};
|
|
14
|
+
const THUMB_CHECKED_CLASSES = {
|
|
15
|
+
large: "translate-x-4",
|
|
16
|
+
medium: "translate-x-4",
|
|
17
|
+
small: "translate-x-3.5",
|
|
18
|
+
};
|
|
19
|
+
const COLOR_STYLES = {
|
|
20
|
+
amber: {
|
|
21
|
+
"--checked-bg-color-override": "var(--ds-gray-100)",
|
|
22
|
+
"--unchecked-bg-color-override": "var(--ds-amber-700)",
|
|
23
|
+
},
|
|
24
|
+
"amber-inverted": {
|
|
25
|
+
"--checked-bg-color-override": "var(--ds-amber-700)",
|
|
26
|
+
"--unchecked-bg-color-override": "var(--ds-gray-100)",
|
|
27
|
+
},
|
|
28
|
+
"amber-track-only": {
|
|
29
|
+
"--checked-bg-color-override": "var(--ds-gray-100)",
|
|
30
|
+
"--unchecked-bg-color-override": "var(--ds-amber-700)",
|
|
31
|
+
},
|
|
32
|
+
red: {
|
|
33
|
+
"--checked-bg-color-override": "var(--ds-gray-100)",
|
|
34
|
+
"--unchecked-bg-color-override": "var(--ds-red-600)",
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
export const Toggle = ({ checked, children, className, color, "data-testid": dataTestId, direction = "label-first", disabled, icon, labelCasing = "title", name, noMargin, onBlur, onChange, onClick, onFocus, onKeyDown, size, stopPropagation, style, ...props }) => {
|
|
38
|
+
const iconContent = checked ? icon?.checked : icon?.unchecked;
|
|
39
|
+
const normalizedSize = size ?? "small";
|
|
40
|
+
const colorStyle = color ? COLOR_STYLES[color] : undefined;
|
|
41
|
+
const handleChange = (event) => {
|
|
42
|
+
if (stopPropagation) {
|
|
43
|
+
event.stopPropagation();
|
|
44
|
+
}
|
|
45
|
+
onChange?.(event.currentTarget.checked);
|
|
46
|
+
};
|
|
47
|
+
return (_jsxs("label", { ...props, className: cn("inline-flex touch-manipulation select-none items-center gap-2 py-[3px] font-medium text-gray-900 text-label-12", direction === "switch-first" && "flex-row-reverse", labelCasing === "title" && "capitalize", disabled && "cursor-not-allowed opacity-60", className), "data-color": color, "data-geist-toggle": "", "data-testid": dataTestId, style: { ...colorStyle, ...style }, children: [children ? _jsx("span", { children: children }) : null, _jsx("input", { checked: checked, className: "peer sr-only", "data-testid": dataTestId ? `${dataTestId}-input` : undefined, disabled: disabled, name: name, onBlur: onBlur, onChange: handleChange, onClick: onClick, onFocus: onFocus, onKeyDown: (event) => {
|
|
48
|
+
if (event.key === "Enter") {
|
|
49
|
+
event.currentTarget.click();
|
|
50
|
+
}
|
|
51
|
+
onKeyDown?.(event);
|
|
52
|
+
}, type: "checkbox" }), _jsx("span", { className: cn("relative inline-block shrink-0 rounded-full border border-transparent bg-[var(--unchecked-bg-color-override,var(--ds-gray-500))] shadow-xs outline-none transition-all peer-checked:bg-[var(--checked-bg-color-override,var(--ds-gray-1000))] peer-focus-visible:border-gray-600 peer-focus-visible:ring-[3px] peer-focus-visible:ring-gray-600/50 dark:bg-gray-alpha-500/80", TRACK_SIZE_CLASSES[normalizedSize], noMargin && "m-0", disabled ? "cursor-not-allowed opacity-50" : "cursor-pointer"), children: _jsx("span", { className: cn("absolute top-1/2 left-px flex -translate-y-1/2 items-center justify-center rounded-full bg-background-100 shadow-sm transition-transform", THUMB_SIZE_CLASSES[normalizedSize], checked && THUMB_CHECKED_CLASSES[normalizedSize]), children: iconContent }) })] }));
|
|
53
|
+
};
|
|
@@ -1,13 +1,39 @@
|
|
|
1
|
-
import type
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { type CSSProperties, type ReactNode, type RefObject } from "react";
|
|
2
|
+
export type Position = "top" | "bottom" | "left" | "right" | "auto";
|
|
3
|
+
export interface TooltipProps {
|
|
4
|
+
as?: "span" | "div";
|
|
5
|
+
boxAlign?: "auto" | "center" | "left" | "right";
|
|
6
|
+
Component?: "span" | "div";
|
|
7
|
+
center?: boolean;
|
|
8
|
+
children?: ReactNode;
|
|
4
9
|
className?: string;
|
|
10
|
+
containerRef?: RefObject<Node | null>;
|
|
11
|
+
cursor?: CSSProperties["cursor"];
|
|
5
12
|
delay?: boolean;
|
|
13
|
+
delayTime?: number;
|
|
6
14
|
desktopOnly?: boolean;
|
|
7
|
-
|
|
15
|
+
disableTriggers?: boolean;
|
|
16
|
+
fill?: boolean;
|
|
17
|
+
focusRing?: boolean;
|
|
18
|
+
forceHide?: boolean;
|
|
19
|
+
hideOnClick?: boolean;
|
|
20
|
+
htmlType?: string;
|
|
21
|
+
invertTheme?: boolean;
|
|
22
|
+
lowerDelay?: boolean;
|
|
23
|
+
maxWidth?: string | number;
|
|
24
|
+
padding?: string | number;
|
|
25
|
+
position?: Position;
|
|
26
|
+
shown?: number;
|
|
27
|
+
sticky?: boolean;
|
|
28
|
+
style?: CSSProperties;
|
|
8
29
|
tabIndex?: number | null;
|
|
9
|
-
text
|
|
30
|
+
text?: ReactNode;
|
|
31
|
+
tip?: boolean;
|
|
32
|
+
tooltipClassName?: string;
|
|
33
|
+
tooltipStyle?: CSSProperties;
|
|
34
|
+
type?: string;
|
|
35
|
+
useParentForBoundingRect?: boolean;
|
|
36
|
+
wrap?: boolean;
|
|
10
37
|
}
|
|
11
|
-
export declare
|
|
12
|
-
export {};
|
|
38
|
+
export declare function Tooltip({ Component: componentProp, as, boxAlign, center, children, className, cursor, delay, delayTime, desktopOnly, disableTriggers, fill, focusRing, forceHide, maxWidth, padding, position, shown, style, tabIndex, text, tip, tooltipClassName, tooltipStyle, type, wrap, }: TooltipProps): import("react/jsx-runtime").JSX.Element;
|
|
13
39
|
//# sourceMappingURL=tooltip.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tooltip.d.ts","sourceRoot":"","sources":["../../../../src/providers/public/components/tooltip.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"tooltip.d.ts","sourceRoot":"","sources":["../../../../src/providers/public/components/tooltip.tsx"],"names":[],"mappings":"AAGA,OAAO,EACL,KAAK,aAAa,EAElB,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAGf,MAAM,MAAM,QAAQ,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;AAEpE,MAAM,WAAW,YAAY;IAC3B,EAAE,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC;IAChD,SAAS,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;IAC3B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,SAAS,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC;IACtC,MAAM,CAAC,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAC;IACjC,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3B,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC1B,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,YAAY,CAAC,EAAE,aAAa,CAAC;IAC7B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,wBAAgB,OAAO,CAAC,EACtB,SAAS,EAAE,aAAa,EACxB,EAAW,EACX,QAAiB,EACjB,MAAa,EACb,QAAQ,EACR,SAAS,EACT,MAAM,EACN,KAAY,EACZ,SAAS,EACT,WAAW,EACX,eAAe,EACf,IAAW,EACX,SAAS,EACT,SAAS,EACT,QAAkB,EAClB,OAAO,EACP,QAAgB,EAChB,KAAS,EACT,KAAK,EACL,QAAY,EACZ,IAAI,EACJ,GAAU,EACV,gBAAgB,EAChB,YAAY,EACZ,IAAI,EACJ,IAAW,GACZ,EAAE,YAAY,2CAiEd"}
|
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { Tooltip as TooltipPrimitive } from "radix-ui";
|
|
4
|
+
import { isValidElement, } from "react";
|
|
4
5
|
import { cn } from "../utils";
|
|
5
|
-
export
|
|
6
|
+
export function Tooltip({ Component: componentProp, as = "span", boxAlign = "auto", center = true, children, className, cursor, delay = true, delayTime, desktopOnly, disableTriggers, fill = true, focusRing, forceHide, maxWidth = "250px", padding, position = "top", shown = 0, style, tabIndex = 0, text, tip = true, tooltipClassName, tooltipStyle, type, wrap = true, }) {
|
|
7
|
+
const Component = componentProp ?? as;
|
|
8
|
+
let align = "center";
|
|
9
|
+
if (boxAlign === "left") {
|
|
10
|
+
align = "start";
|
|
11
|
+
}
|
|
12
|
+
else if (boxAlign === "right") {
|
|
13
|
+
align = "end";
|
|
14
|
+
}
|
|
15
|
+
const side = position === "auto" ? "top" : position;
|
|
16
|
+
return (_jsx(TooltipPrimitive.Provider, { delayDuration: delay === false ? 0 : (delayTime ?? 300), children: _jsxs(TooltipPrimitive.Root, { defaultOpen: shown > 0, open: disableTriggers || forceHide ? false : undefined, children: [_jsx(TooltipPrimitive.Trigger, { asChild: true, children: _jsx(Component, { className: cn("inline-flex", focusRing && "focus-visible:shadow-[var(--ds-focus-ring)]", className), "data-tooltip-type": type, style: { cursor, ...style }, tabIndex: tabIndex ?? undefined, children: isValidElement(children) ? children : _jsx("span", { children: children }) }) }), _jsx(TooltipPrimitive.Portal, { children: _jsxs(TooltipPrimitive.Content, { align: align, className: cn("fade-in-0 zoom-in-95 data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-70 w-fit origin-(--radix-tooltip-content-transform-origin) animate-in text-balance rounded-md bg-gray-1000 px-3 py-1.5 text-background-100 text-xs shadow-[var(--ds-shadow-small)] data-[state=closed]:animate-out", !fill && "bg-background-100 text-gray-1000", desktopOnly && "max-[600px]:hidden", tooltipClassName), side: side, sideOffset: 6, style: {
|
|
17
|
+
maxWidth,
|
|
18
|
+
padding,
|
|
19
|
+
textAlign: center ? "center" : undefined,
|
|
20
|
+
whiteSpace: wrap ? undefined : "nowrap",
|
|
21
|
+
...tooltipStyle,
|
|
22
|
+
}, children: [text, tip ? (_jsx(TooltipPrimitive.Arrow, { className: cn("z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-gray-1000 fill-gray-1000", !fill && "bg-background-100 fill-background-100") })) : null] }) })] }) }));
|
|
23
|
+
}
|
|
@@ -37,4 +37,5 @@ export { IconSun } from "../../assets/geistcn/icons/named/icon-sun";
|
|
|
37
37
|
export { IconTerminal } from "../../assets/geistcn/icons/named/icon-terminal";
|
|
38
38
|
export { IconThumbUp } from "../../assets/geistcn/icons/named/icon-thumb-up";
|
|
39
39
|
export { IconTrash } from "../../assets/geistcn/icons/named/icon-trash";
|
|
40
|
+
export { IconAcronymTs } from "../../assets/icons/icon-acronym-ts";
|
|
40
41
|
//# sourceMappingURL=icons.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../../../src/providers/public-assets/icons.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,wDAAwD,CAAC;AAC7F,OAAO,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAC5E,OAAO,EAAE,iBAAiB,EAAE,MAAM,uDAAuD,CAAC;AAC1F,OAAO,EAAE,aAAa,EAAE,MAAM,kDAAkD,CAAC;AACjF,OAAO,EAAE,WAAW,EAAE,MAAM,gDAAgD,CAAC;AAC7E,OAAO,EAAE,qBAAqB,EAAE,MAAM,4DAA4D,CAAC;AACnG,OAAO,EAAE,YAAY,EAAE,MAAM,gDAAgD,CAAC;AAC9E,OAAO,EAAE,OAAO,EAAE,MAAM,2CAA2C,CAAC;AACpE,OAAO,EAAE,SAAS,EAAE,MAAM,6CAA6C,CAAC;AACxE,OAAO,EAAE,sBAAsB,EAAE,MAAM,4DAA4D,CAAC;AACpG,OAAO,EAAE,eAAe,EAAE,MAAM,oDAAoD,CAAC;AACrF,OAAO,EAAE,oBAAoB,EAAE,MAAM,0DAA0D,CAAC;AAChG,OA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E,OAAO,EAAE,cAAc,EAAE,MAAM,mDAAmD,CAAC;AACnF,OAAO,EAAE,SAAS,EAAE,MAAM,6CAA6C,CAAC;AACxE,OAAO,EAAE,iBAAiB,EAAE,MAAM,sDAAsD,CAAC;AACzF,OAAO,EAAE,YAAY,EAAE,MAAM,gDAAgD,CAAC;AAC9E,OAAO,EAAE,QAAQ,EAAE,MAAM,4CAA4C,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,iDAAiD,CAAC;AAC/E,OAAO,EAAE,SAAS,EAAE,MAAM,6CAA6C,CAAC;AACxE,OAAO,EAAE,eAAe,EAAE,MAAM,mDAAmD,CAAC;AACpF,OAAO,EAAE,aAAa,EAAE,MAAM,iDAAiD,CAAC;AAChF,OAAO,EAAE,QAAQ,EAAE,MAAM,4CAA4C,CAAC;AACtE,OAAO,EAAE,WAAW,EAAE,MAAM,gDAAgD,CAAC;AAC7E,OAAO,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAC5E,OAAO,EAAE,QAAQ,EAAE,MAAM,4CAA4C,CAAC;AACtE,OAAO,EAAE,OAAO,EAAE,MAAM,2CAA2C,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,qDAAqD,CAAC;AACvF,OAAO,EAAE,cAAc,EAAE,MAAM,mDAAmD,CAAC;AACnF,OAAO,EAAE,OAAO,EAAE,MAAM,2CAA2C,CAAC;AACpE,OAAO,EAAE,YAAY,EAAE,MAAM,gDAAgD,CAAC;AAC9E,OAAO,EAAE,WAAW,EAAE,MAAM,gDAAgD,CAAC;AAC7E,OAAO,EAAE,SAAS,EAAE,MAAM,6CAA6C,CAAC;AACxE,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC"}
|
|
@@ -37,3 +37,4 @@ export { IconSun } from "../../assets/geistcn/icons/named/icon-sun";
|
|
|
37
37
|
export { IconTerminal } from "../../assets/geistcn/icons/named/icon-terminal";
|
|
38
38
|
export { IconThumbUp } from "../../assets/geistcn/icons/named/icon-thumb-up";
|
|
39
39
|
export { IconTrash } from "../../assets/geistcn/icons/named/icon-trash";
|
|
40
|
+
export { IconAcronymTs } from "../../assets/icons/icon-acronym-ts";
|
package/docs/agents.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Geistdocs Package Docs
|
|
2
2
|
|
|
3
|
-
These docs are bundled with `@vercel/geistdocs` 2.
|
|
3
|
+
These docs are bundled with `@vercel/geistdocs` 2.7.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
|
|
@@ -29,7 +29,7 @@ They are generated from `apps/template/content/docs` during the package build.
|
|
|
29
29
|
- [Migrate to Geistdocs](pages/migration.md): Move an existing documentation site to @vercel/geistdocs while keeping local content, routing, middleware behavior, and AI-readable surfaces intact.
|
|
30
30
|
- [Choose a Geistdocs package](pages/packages.md): Use the public package by default and the private package only where restricted Vercel npm dependencies are already available.
|
|
31
31
|
- [Configuration](pages/configuration.md): Configure site metadata, navigation, AI features, page actions, translations, and local adapters.
|
|
32
|
-
- [
|
|
32
|
+
- [MDX Components](pages/syntax.md): MDX component and authoring reference covering tabs, text formatting, code blocks, line highlighting, and Mermaid diagrams.
|
|
33
33
|
- [Geistdocs Provider](pages/provider.md): The root provider component that wraps your application to handle toast notifications, search, and analytics.
|
|
34
34
|
- [Versioned docs](pages/versioned-docs.md): Use createVersionedSources to configure stable, pre-release, or host-based documentation versions.
|
|
35
35
|
- [Proxy and markdown routes](pages/proxy.md): Configure createProxy with generated route discovery, request hooks, markdown mappings, and a static Next.js matcher.
|
|
@@ -37,14 +37,37 @@ They are generated from `apps/template/content/docs` during the package build.
|
|
|
37
37
|
- [.md Extension](pages/md.md): Access any documentation page as raw Markdown by appending .md or .mdx to the URL for AI tool consumption.
|
|
38
38
|
- [Agent readiness](pages/agent-readiness.md): Generate /agents.md and /.well-known/mcp.json from Geistdocs config so agents can find docs, Markdown surfaces, API specs, and MCP endpoints.
|
|
39
39
|
- [Ask AI](pages/ask-ai.md): An AI-powered chat assistant with context-aware search, persistent history, and suggested prompts for your documentation.
|
|
40
|
+
- [Badge](pages/components/badge.md): Import Badge from the package component subpath for labels outside authored MDX.
|
|
41
|
+
- [Button](pages/components/button.md): Use the provider-backed Button in application UI or directly in MDX.
|
|
42
|
+
- [Callout](pages/components/callout.md): Use Callout directly or compose its container, title, and description primitives.
|
|
43
|
+
- [Code Block](pages/components/code-block.md): Use CodeBlock when code is highlighted or assembled outside authored Markdown fences.
|
|
44
|
+
- [Code Block Tabs](pages/components/code-block-tabs.md): Compose code-block tab lists, triggers, and panels outside authored MDX.
|
|
45
|
+
- [Collapsible](pages/components/collapsible.md): Compose Collapsible, CollapsibleTrigger, and CollapsibleContent in custom React UI.
|
|
46
|
+
- [Command Prompt](pages/components/command-prompt.md): Compose the CommandPrompt primitives for application-owned install and setup commands.
|
|
47
|
+
- [Components](pages/components/index.md): Browse every component subpath exported by Geistdocs. These components can be imported into application code without relying on the default MDX component map.
|
|
40
48
|
- [Configure sidebar navigation](pages/guides/nested-navigation.md): Configure sidebar order, section labels, folder landing pages, and deeply nested page trees with meta.json files.
|
|
49
|
+
- [Copy Prompt](pages/components/copy-prompt.md): Use CopyPrompt for reusable instructions that readers can send to an AI assistant.
|
|
50
|
+
- [Details](pages/components/details.md): Compose Details and Summary for accessible browser-native disclosures.
|
|
51
|
+
- [Dropdown Menu](pages/components/dropdown-menu.md): Compose DropdownMenu primitives for application-owned menus outside MDX.
|
|
41
52
|
- [Edit on GitHub](pages/edit-on-github.md): A direct link on every documentation page that lets readers propose changes through GitHub pull requests.
|
|
42
53
|
- [Feedback](pages/feedback.md): An interactive feedback widget that collects user sentiment and creates structured GitHub Issues automatically.
|
|
54
|
+
- [Image](pages/components/image.md): Use the Geistdocs Image wrapper for documentation-aware Next.js images.
|
|
43
55
|
- [Improve Ask AI answers with Mixedbread](pages/mixedbread-retrieval.md): Provision a Mixedbread Store for one Geistdocs consumer site, enable semantic retrieval, and sync documentation during production builds.
|
|
56
|
+
- [Input](pages/components/input.md): Use Input for text entry in custom documentation and application interfaces.
|
|
44
57
|
- [Internationalization](pages/internationalization.md): Serve documentation in multiple languages with automatic translation via the Geistdocs CLI and Fumadocs routing.
|
|
45
58
|
- [llms.txt](pages/llms-txt.md): A single endpoint that returns all documentation as plain Markdown text following the llms.txt standard.
|
|
59
|
+
- [Mermaid](pages/components/mermaid.md): Use Mermaid directly when diagram source is assembled outside an MDX Mermaid fence.
|
|
60
|
+
- [Native Link](pages/components/link.md): Use NativeDocsLink where Next.js client navigation is not appropriate.
|
|
61
|
+
- [Navigation Menu](pages/components/navigation-menu.md): Compose NavigationMenu primitives for custom product and documentation navigation.
|
|
46
62
|
- [Open in Chat](pages/open-in-chat.md): Transfer documentation context to AI chat platforms like ChatGPT, Claude, Cursor, and v0 with a single click.
|
|
63
|
+
- [Popover](pages/components/popover.md): Compose Popover, PopoverTrigger, and PopoverContent outside MDX.
|
|
47
64
|
- [RSS](pages/rss.md): An automatically generated RSS 2.0 feed that keeps users informed when documentation is published or updated.
|
|
65
|
+
- [Scroll Area](pages/components/scroll-area.md): Compose ScrollArea and ScrollBar for constrained custom interfaces.
|
|
48
66
|
- [Steps](pages/components/steps.md): Write consecutive headings that start with a number, such as "### 1. Install", to render a numbered step list. The Steps and Step components cover cases where a heading must be wrapped in another component.
|
|
49
67
|
- [Table of contents](pages/table-of-contents.md): Geistdocs builds the "On this page" outline from your headings, indents sub-headings under their parent, and tracks the active section along a straight vertical guide rail.
|
|
68
|
+
- [Tabs](pages/components/tabs.md): Use Tabs for navigation-only controls or TabsWithChildren and TabContent for mounted content panels.
|
|
69
|
+
- [Theme Switcher](pages/components/theme-switcher.md): Use ThemeSwitcher in custom navigation, settings, and footer UI.
|
|
70
|
+
- [Toggle](pages/components/toggle.md): Toggle is the provider-backed replacement for the former Switch export.
|
|
71
|
+
- [Tooltip](pages/components/tooltip.md): Wrap controls with provider-backed Tooltip content outside MDX.
|
|
72
|
+
- [Video](pages/components/video.md): Use Video for embedded video sources inside React UI or authored MDX.
|
|
50
73
|
- [WebMCP](pages/webmcp.md): Expose documentation search and page reading to browser agents.
|