@wrksz/docs 0.0.0-stage → 0.1.1
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/LICENSE +21 -0
- package/README.md +157 -2
- package/dist/agents.d.ts +30 -0
- package/dist/agents.js +70 -0
- package/dist/components/agent-logos.js +90 -0
- package/dist/components/agent-prompt.d.ts +29 -0
- package/dist/components/agent-prompt.js +100 -0
- package/dist/components/badge.d.ts +16 -0
- package/dist/components/badge.js +26 -0
- package/dist/components/brand.js +32 -0
- package/dist/components/callout.d.ts +24 -0
- package/dist/components/callout.js +58 -0
- package/dist/components/cards.d.ts +26 -0
- package/dist/components/cards.js +48 -0
- package/dist/components/code-body.js +18 -0
- package/dist/components/code-group.d.ts +20 -0
- package/dist/components/code-group.js +41 -0
- package/dist/components/code-tabs.d.ts +30 -0
- package/dist/components/code-tabs.js +49 -0
- package/dist/components/content-tabs.d.ts +14 -0
- package/dist/components/content-tabs.js +27 -0
- package/dist/components/copy-code.js +41 -0
- package/dist/components/deferred-analytics.js +5 -0
- package/dist/components/details.d.ts +20 -0
- package/dist/components/details.js +29 -0
- package/dist/components/heading-link.js +23 -0
- package/dist/components/heading.d.ts +5 -0
- package/dist/components/heading.js +22 -0
- package/dist/components/icons.js +362 -0
- package/dist/components/image.d.ts +27 -0
- package/dist/components/image.js +204 -0
- package/dist/components/inline-text.js +14 -0
- package/dist/components/install.d.ts +22 -0
- package/dist/components/install.js +62 -0
- package/dist/components/mdx-tabs.d.ts +22 -0
- package/dist/components/mdx-tabs.js +30 -0
- package/dist/components/practice.d.ts +41 -0
- package/dist/components/practice.js +99 -0
- package/dist/components/props.d.ts +37 -0
- package/dist/components/props.js +70 -0
- package/dist/components/status.js +35 -0
- package/dist/components/steps.d.ts +18 -0
- package/dist/components/steps.js +23 -0
- package/dist/components/theme-switch.js +31 -0
- package/dist/components/ui/kbd.js +410 -0
- package/dist/components/ui/scroll-area.js +169 -0
- package/dist/components/ui/table.d.ts +33 -0
- package/dist/components/ui/table.js +103 -0
- package/dist/components/ui/tabs.js +69 -0
- package/dist/components/ui/toast.js +629 -0
- package/dist/components/ui/tooltip.js +31 -0
- package/dist/components/wrksz-mark.js +12 -0
- package/dist/docs/index.d.ts +8 -0
- package/dist/docs/index.js +8 -0
- package/dist/docs/layout.d.ts +6 -0
- package/dist/docs/layout.js +10 -0
- package/dist/docs/page-actions.d.ts +36 -0
- package/dist/docs/page-actions.js +136 -0
- package/dist/docs/page-footer.d.ts +14 -0
- package/dist/docs/page-footer.js +68 -0
- package/dist/docs/page-header.d.ts +13 -0
- package/dist/docs/page-header.js +57 -0
- package/dist/docs/page.d.ts +16 -0
- package/dist/docs/page.js +38 -0
- package/dist/docs/reading.js +64 -0
- package/dist/docs/shell.js +101 -0
- package/dist/docs/sidebar.js +161 -0
- package/dist/docs/toc-bar.d.ts +12 -0
- package/dist/docs/toc-bar.js +132 -0
- package/dist/docs/toc.d.ts +11 -0
- package/dist/docs/toc.js +127 -0
- package/dist/fonts/Inter-Italic.woff2 +0 -0
- package/dist/fonts/Inter-LICENSE.txt +92 -0
- package/dist/fonts/Inter.woff2 +0 -0
- package/dist/fonts/IoskeleyMono-Bold.woff2 +0 -0
- package/dist/fonts/IoskeleyMono-Italic.woff2 +0 -0
- package/dist/fonts/IoskeleyMono-LICENSE.txt +92 -0
- package/dist/fonts/IoskeleyMono-Regular.woff2 +0 -0
- package/dist/fonts.d.ts +1 -0
- package/dist/fonts.js +38 -0
- package/dist/home/features.d.ts +39 -0
- package/dist/home/features.js +75 -0
- package/dist/home/footer.d.ts +4 -0
- package/dist/home/footer.js +79 -0
- package/dist/home/hero-content.js +102 -0
- package/dist/home/hero-install.js +128 -0
- package/dist/home/hero-stage.d.ts +4 -0
- package/dist/home/hero-stage.js +9 -0
- package/dist/home/hero.d.ts +6 -0
- package/dist/home/hero.js +16 -0
- package/dist/home/home-header.d.ts +1 -0
- package/dist/home/home-header.js +173 -0
- package/dist/home/index.d.ts +7 -0
- package/dist/home/index.js +7 -0
- package/dist/home/layout.d.ts +6 -0
- package/dist/home/layout.js +15 -0
- package/dist/home/reveal.js +31 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +4 -0
- package/dist/lib/clipboard.js +55 -0
- package/dist/lib/cn.js +1 -0
- package/dist/lib/format.js +9 -0
- package/dist/lib/package-manager-script.js +12 -0
- package/dist/lib/package-manager.js +54 -0
- package/dist/lib/theme-config.js +10 -0
- package/dist/llms.d.ts +34 -0
- package/dist/llms.js +111 -0
- package/dist/next.d.ts +18 -0
- package/dist/next.js +45 -0
- package/dist/node_modules/.pnpm/@types_mdast@4.0.4/node_modules/@types/mdast/index.d.ts +930 -0
- package/dist/node_modules/.pnpm/@types_mdx@2.0.14/node_modules/@types/mdx/types.d.ts +81 -0
- package/dist/node_modules/.pnpm/@types_unist@3.0.3/node_modules/@types/unist/index.d.ts +80 -0
- package/dist/registry.d.ts +61 -0
- package/dist/registry.js +113 -0
- package/dist/root.d.ts +9 -0
- package/dist/root.js +34 -0
- package/dist/search.d.ts +5 -0
- package/dist/search.js +43 -0
- package/dist/seo/index.d.ts +6 -0
- package/dist/seo/index.js +6 -0
- package/dist/seo/json-ld.d.ts +17 -0
- package/dist/seo/json-ld.js +88 -0
- package/dist/seo/metadata.d.ts +21 -0
- package/dist/seo/metadata.js +75 -0
- package/dist/seo/robots.d.ts +14 -0
- package/dist/seo/robots.js +18 -0
- package/dist/seo/sitemap.d.ts +16 -0
- package/dist/seo/sitemap.js +26 -0
- package/dist/seo/url.d.ts +6 -0
- package/dist/seo/url.js +11 -0
- package/dist/server.js +63 -0
- package/dist/site-context.js +17 -0
- package/dist/site.d.ts +41 -0
- package/dist/site.js +13 -0
- package/dist/source/compile.d.ts +6 -0
- package/dist/source/compile.js +32 -0
- package/dist/source/errors.d.ts +4 -0
- package/dist/source/errors.js +10 -0
- package/dist/source/frontmatter.d.ts +13 -0
- package/dist/source/frontmatter.js +102 -0
- package/dist/source/highlight.js +102 -0
- package/dist/source/index.d.ts +36 -0
- package/dist/source/index.js +102 -0
- package/dist/source/markdown.d.ts +48 -0
- package/dist/source/markdown.js +393 -0
- package/dist/source/prompt.js +33 -0
- package/dist/source/scan.d.ts +8 -0
- package/dist/source/scan.js +64 -0
- package/dist/source/toc.d.ts +5 -0
- package/dist/source/toc.js +28 -0
- package/dist/source/tree.d.ts +29 -0
- package/dist/source/tree.js +91 -0
- package/dist/styles.css +879 -0
- package/dist/typography.d.ts +101 -0
- package/dist/typography.js +232 -0
- package/package.json +84 -4
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
type TabProps = {
|
|
3
|
+
title: string;
|
|
4
|
+
children?: ReactNode;
|
|
5
|
+
};
|
|
6
|
+
/** One tab of `<Tabs>`; `title` is the text on the tab. Renders nothing on its own. */
|
|
7
|
+
export declare function MdxTab({ children }: TabProps): import("react").JSX.Element;
|
|
8
|
+
/**
|
|
9
|
+
* Tabs for any content in MDX, one per `<Tab title="…">`.
|
|
10
|
+
*
|
|
11
|
+
* ```mdx
|
|
12
|
+
* <Tabs>
|
|
13
|
+
* <Tab title="App Router">…</Tab>
|
|
14
|
+
* <Tab title="Pages Router">…</Tab>
|
|
15
|
+
* </Tabs>
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export declare function MdxTabs({ label, children }: {
|
|
19
|
+
label?: string;
|
|
20
|
+
children: ReactNode;
|
|
21
|
+
}): import("react").JSX.Element;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Children, isValidElement } from "react";
|
|
2
|
+
import { ContentTabs } from "./content-tabs.js";
|
|
3
|
+
import { Fragment as Fragment$1, jsx } from "react/jsx-runtime";
|
|
4
|
+
// src/components/mdx-tabs.tsx
|
|
5
|
+
/** One tab of `<Tabs>`; `title` is the text on the tab. Renders nothing on its own. */
|
|
6
|
+
function MdxTab({ children }) {
|
|
7
|
+
return /* @__PURE__ */ jsx(Fragment$1, { children });
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Tabs for any content in MDX, one per `<Tab title="…">`.
|
|
11
|
+
*
|
|
12
|
+
* ```mdx
|
|
13
|
+
* <Tabs>
|
|
14
|
+
* <Tab title="App Router">…</Tab>
|
|
15
|
+
* <Tab title="Pages Router">…</Tab>
|
|
16
|
+
* </Tabs>
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
function MdxTabs({ label = "Options", children }) {
|
|
20
|
+
const tabs = Children.toArray(children).filter((child) => isValidElement(child) && typeof child.props.title === "string");
|
|
21
|
+
return /* @__PURE__ */ jsx(ContentTabs, {
|
|
22
|
+
label,
|
|
23
|
+
items: tabs.map((tab, index) => ({
|
|
24
|
+
value: String(index),
|
|
25
|
+
label: tab.props.title,
|
|
26
|
+
content: tab.props.children
|
|
27
|
+
}))
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
export { MdxTab, MdxTabs };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* An example to follow, usually a code block, with a short caption saying what it shows.
|
|
4
|
+
*
|
|
5
|
+
* ```mdx
|
|
6
|
+
* <Do caption="Rendering it in the root layout">
|
|
7
|
+
* ```tsx …
|
|
8
|
+
* </Do>
|
|
9
|
+
* ```
|
|
10
|
+
*/
|
|
11
|
+
export declare function Do({ caption, children }: {
|
|
12
|
+
caption?: ReactNode;
|
|
13
|
+
children: ReactNode;
|
|
14
|
+
}): import("react").JSX.Element;
|
|
15
|
+
/** An example to avoid; pair it with a `<Do>` that shows the fix. */
|
|
16
|
+
export declare function Dont({ caption, children }: {
|
|
17
|
+
caption?: ReactNode;
|
|
18
|
+
children: ReactNode;
|
|
19
|
+
}): import("react").JSX.Element;
|
|
20
|
+
/**
|
|
21
|
+
* Mistakes next to what to do instead, one `<Pair>` per row. Two columns on wide screens,
|
|
22
|
+
* one under the other on a phone.
|
|
23
|
+
*
|
|
24
|
+
* ```mdx
|
|
25
|
+
* <Pairs left="Avoid" right="Use instead">
|
|
26
|
+
* <Pair label="Two theme providers on one root">One provider in the root layout.</Pair>
|
|
27
|
+
* </Pairs>
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
export declare function Pairs({ left, right, children }: {
|
|
31
|
+
/** Heading of the first column. */
|
|
32
|
+
left?: ReactNode;
|
|
33
|
+
/** Heading of the second column. */
|
|
34
|
+
right?: ReactNode;
|
|
35
|
+
children: ReactNode;
|
|
36
|
+
}): import("react").JSX.Element;
|
|
37
|
+
/** One row of `<Pairs>`: `label` is the mistake, the content is what to do instead. */
|
|
38
|
+
export declare function Pair({ label, children }: {
|
|
39
|
+
label: ReactNode;
|
|
40
|
+
children: ReactNode;
|
|
41
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { DangerIcon, SuccessIcon } from "./icons.js";
|
|
2
|
+
import { InlineText } from "./inline-text.js";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
// src/components/practice.tsx
|
|
5
|
+
function Practice({ good, caption, children }) {
|
|
6
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
7
|
+
"data-practice": good ? "do" : "dont",
|
|
8
|
+
className: "flex flex-col gap-2.5",
|
|
9
|
+
children: [/* @__PURE__ */ jsxs("p", {
|
|
10
|
+
className: "flex items-center gap-2 text-sm",
|
|
11
|
+
children: [
|
|
12
|
+
/* @__PURE__ */ jsx(good ? SuccessIcon : DangerIcon, { className: `size-4 shrink-0 ${good ? "text-(--color-success)" : "text-(--color-danger)"}` }),
|
|
13
|
+
/* @__PURE__ */ jsx("span", {
|
|
14
|
+
className: "font-medium text-fd-foreground",
|
|
15
|
+
children: good ? "Do" : "Don't"
|
|
16
|
+
}),
|
|
17
|
+
caption ? /* @__PURE__ */ jsx("span", {
|
|
18
|
+
className: "text-fd-muted-foreground",
|
|
19
|
+
children: /* @__PURE__ */ jsx(InlineText, { children: caption })
|
|
20
|
+
}) : null
|
|
21
|
+
]
|
|
22
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
23
|
+
className: "docs-prose",
|
|
24
|
+
children
|
|
25
|
+
})]
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* An example to follow, usually a code block, with a short caption saying what it shows.
|
|
30
|
+
*
|
|
31
|
+
* ```mdx
|
|
32
|
+
* <Do caption="Rendering it in the root layout">
|
|
33
|
+
* ```tsx …
|
|
34
|
+
* </Do>
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
function Do({ caption, children }) {
|
|
38
|
+
return /* @__PURE__ */ jsx(Practice, {
|
|
39
|
+
good: true,
|
|
40
|
+
caption,
|
|
41
|
+
children
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
/** An example to avoid; pair it with a `<Do>` that shows the fix. */
|
|
45
|
+
function Dont({ caption, children }) {
|
|
46
|
+
return /* @__PURE__ */ jsx(Practice, {
|
|
47
|
+
good: false,
|
|
48
|
+
caption,
|
|
49
|
+
children
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Mistakes next to what to do instead, one `<Pair>` per row. Two columns on wide screens,
|
|
54
|
+
* one under the other on a phone.
|
|
55
|
+
*
|
|
56
|
+
* ```mdx
|
|
57
|
+
* <Pairs left="Avoid" right="Use instead">
|
|
58
|
+
* <Pair label="Two theme providers on one root">One provider in the root layout.</Pair>
|
|
59
|
+
* </Pairs>
|
|
60
|
+
* ```
|
|
61
|
+
*/
|
|
62
|
+
function Pairs({ left = "Avoid", right = "Use instead", children }) {
|
|
63
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
64
|
+
className: "text-[0.9375rem] leading-relaxed",
|
|
65
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
66
|
+
className: "hidden grid-cols-2 gap-6 pb-2 text-sm text-fd-muted-foreground sm:grid",
|
|
67
|
+
children: [/* @__PURE__ */ jsxs("span", {
|
|
68
|
+
className: "flex items-center gap-2",
|
|
69
|
+
children: [/* @__PURE__ */ jsx(DangerIcon, { className: "size-4 text-(--color-danger)" }), left]
|
|
70
|
+
}), /* @__PURE__ */ jsxs("span", {
|
|
71
|
+
className: "flex items-center gap-2",
|
|
72
|
+
children: [/* @__PURE__ */ jsx(SuccessIcon, { className: "size-4 text-(--color-success)" }), right]
|
|
73
|
+
})]
|
|
74
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
75
|
+
className: "divide-y divide-fd-border border-y border-fd-border",
|
|
76
|
+
children
|
|
77
|
+
})]
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
/** One row of `<Pairs>`: `label` is the mistake, the content is what to do instead. */
|
|
81
|
+
function Pair({ label, children }) {
|
|
82
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
83
|
+
className: "grid gap-1 py-3 sm:grid-cols-2 sm:gap-6",
|
|
84
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
85
|
+
className: "flex gap-2 text-fd-muted-foreground",
|
|
86
|
+
children: [/* @__PURE__ */ jsx(DangerIcon, { className: "mt-[0.3em] size-4 shrink-0 text-(--color-danger) sm:hidden" }), /* @__PURE__ */ jsx("span", {
|
|
87
|
+
className: "docs-compact",
|
|
88
|
+
children: /* @__PURE__ */ jsx(InlineText, { children: label })
|
|
89
|
+
})]
|
|
90
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
91
|
+
className: "flex gap-2 text-fd-foreground",
|
|
92
|
+
children: [/* @__PURE__ */ jsx(SuccessIcon, { className: "mt-[0.3em] size-4 shrink-0 text-(--color-success) sm:hidden" }), /* @__PURE__ */ jsx("div", {
|
|
93
|
+
className: "docs-compact min-w-0",
|
|
94
|
+
children
|
|
95
|
+
})]
|
|
96
|
+
})]
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
export { Do, Dont, Pair, Pairs };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* A list of props or options, one `<Prop>` per entry. It stacks instead of using a table,
|
|
4
|
+
* so long types wrap and nothing scrolls sideways on a phone.
|
|
5
|
+
*
|
|
6
|
+
* ```mdx
|
|
7
|
+
* <Props>
|
|
8
|
+
* <Prop name="defaultTheme" type="string" default='"system"'>
|
|
9
|
+
* Theme used when no preference is stored.
|
|
10
|
+
* </Prop>
|
|
11
|
+
* </Props>
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
export declare function Props({ className, children }: {
|
|
15
|
+
className?: string;
|
|
16
|
+
children: ReactNode;
|
|
17
|
+
}): import("react").JSX.Element;
|
|
18
|
+
/**
|
|
19
|
+
* One entry of `<Props>`: name, type and default on the first line, the description below.
|
|
20
|
+
* `data-prop-name` and `data-prop-type` let other components read the list, e.g. to preview
|
|
21
|
+
* a type on hover.
|
|
22
|
+
*/
|
|
23
|
+
export declare function Prop({ name, type, default: fallback, required, deprecated, since, children }: {
|
|
24
|
+
/** Name of the prop or option. */
|
|
25
|
+
name: string;
|
|
26
|
+
/** Its TypeScript type, written out as text. */
|
|
27
|
+
type?: string;
|
|
28
|
+
/** Value used when it is left out, written as code, e.g. `'"system"'`. */
|
|
29
|
+
default?: string;
|
|
30
|
+
/** Marks the prop as one that has to be passed. */
|
|
31
|
+
required?: boolean;
|
|
32
|
+
/** Marks the prop as one to stop using; say what replaces it in the description. */
|
|
33
|
+
deprecated?: boolean;
|
|
34
|
+
/** Version that added the prop, e.g. `v2.1`. */
|
|
35
|
+
since?: string;
|
|
36
|
+
children?: ReactNode;
|
|
37
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { cn } from "../lib/cn.js";
|
|
2
|
+
import { Badge } from "./badge.js";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
// src/components/props.tsx
|
|
5
|
+
/**
|
|
6
|
+
* A list of props or options, one `<Prop>` per entry. It stacks instead of using a table,
|
|
7
|
+
* so long types wrap and nothing scrolls sideways on a phone.
|
|
8
|
+
*
|
|
9
|
+
* ```mdx
|
|
10
|
+
* <Props>
|
|
11
|
+
* <Prop name="defaultTheme" type="string" default='"system"'>
|
|
12
|
+
* Theme used when no preference is stored.
|
|
13
|
+
* </Prop>
|
|
14
|
+
* </Props>
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
function Props({ className, children }) {
|
|
18
|
+
return /* @__PURE__ */ jsx("div", {
|
|
19
|
+
"data-props-table": true,
|
|
20
|
+
className: cn("divide-y divide-fd-border border-y border-fd-border", className),
|
|
21
|
+
children
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* One entry of `<Props>`: name, type and default on the first line, the description below.
|
|
26
|
+
* `data-prop-name` and `data-prop-type` let other components read the list, e.g. to preview
|
|
27
|
+
* a type on hover.
|
|
28
|
+
*/
|
|
29
|
+
function Prop({ name, type, default: fallback, required = false, deprecated = false, since, children }) {
|
|
30
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
31
|
+
"data-prop-name": name,
|
|
32
|
+
"data-prop-type": type,
|
|
33
|
+
className: "py-3.5",
|
|
34
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
35
|
+
className: "flex flex-wrap items-baseline gap-x-3 gap-y-1",
|
|
36
|
+
children: [
|
|
37
|
+
/* @__PURE__ */ jsx("code", {
|
|
38
|
+
className: cn("font-mono text-sm font-medium text-fd-foreground", deprecated && "line-through decoration-fd-muted-foreground"),
|
|
39
|
+
children: name
|
|
40
|
+
}),
|
|
41
|
+
type ? /* @__PURE__ */ jsx("code", {
|
|
42
|
+
className: "min-w-0 font-mono text-[0.8125rem] wrap-anywhere text-(--code-command)",
|
|
43
|
+
children: type
|
|
44
|
+
}) : null,
|
|
45
|
+
fallback ? /* @__PURE__ */ jsxs("span", {
|
|
46
|
+
className: "text-[0.8125rem] text-fd-muted-foreground",
|
|
47
|
+
children: ["Default ", /* @__PURE__ */ jsx("code", {
|
|
48
|
+
className: "font-mono text-fd-foreground",
|
|
49
|
+
children: fallback
|
|
50
|
+
})]
|
|
51
|
+
}) : null,
|
|
52
|
+
required || deprecated || since ? /* @__PURE__ */ jsxs("span", {
|
|
53
|
+
className: "flex items-center gap-1.5 self-center",
|
|
54
|
+
children: [
|
|
55
|
+
required ? /* @__PURE__ */ jsx(Badge, { children: "required" }) : null,
|
|
56
|
+
deprecated ? /* @__PURE__ */ jsx(Badge, {
|
|
57
|
+
tone: "warning",
|
|
58
|
+
children: "deprecated"
|
|
59
|
+
}) : null,
|
|
60
|
+
since ? /* @__PURE__ */ jsx(Badge, { children: since }) : null
|
|
61
|
+
]
|
|
62
|
+
}) : null
|
|
63
|
+
]
|
|
64
|
+
}), children ? /* @__PURE__ */ jsx("div", {
|
|
65
|
+
className: "docs-compact mt-1.5 text-[0.9375rem] leading-relaxed text-fd-muted-foreground",
|
|
66
|
+
children
|
|
67
|
+
}) : null]
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
export { Prop, Props };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { cn } from "../lib/cn.js";
|
|
2
|
+
import { FlaskIcon, SparkIcon, WarningIcon } from "./icons.js";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
// src/components/status.tsx
|
|
5
|
+
const STATUS = {
|
|
6
|
+
new: {
|
|
7
|
+
label: "New",
|
|
8
|
+
Icon: SparkIcon
|
|
9
|
+
},
|
|
10
|
+
beta: {
|
|
11
|
+
label: "Beta",
|
|
12
|
+
Icon: FlaskIcon
|
|
13
|
+
},
|
|
14
|
+
deprecated: {
|
|
15
|
+
label: "Deprecated",
|
|
16
|
+
Icon: WarningIcon
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
function Status({ status, iconOnly = false, className }) {
|
|
20
|
+
if (!status) return null;
|
|
21
|
+
const { label, Icon } = STATUS[status];
|
|
22
|
+
if (iconOnly) return /* @__PURE__ */ jsxs("span", {
|
|
23
|
+
title: label,
|
|
24
|
+
className: cn("inline-flex shrink-0 items-center text-fd-muted-foreground", className),
|
|
25
|
+
children: [/* @__PURE__ */ jsx(Icon, { className: "size-3.5 shrink-0" }), /* @__PURE__ */ jsx("span", {
|
|
26
|
+
className: "sr-only",
|
|
27
|
+
children: label
|
|
28
|
+
})]
|
|
29
|
+
});
|
|
30
|
+
return /* @__PURE__ */ jsxs("span", {
|
|
31
|
+
className: cn("inline-flex shrink-0 items-center gap-1 text-xs text-fd-muted-foreground", className),
|
|
32
|
+
children: [/* @__PURE__ */ jsx(Icon, { className: "size-3.5 shrink-0" }), label]
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
export { Status };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Numbered steps along a line. Each `###` heading inside starts a step, so steps keep their
|
|
4
|
+
* anchors and show up in the table of contents like any other heading.
|
|
5
|
+
*
|
|
6
|
+
* ```mdx
|
|
7
|
+
* <Steps>
|
|
8
|
+
* ### Install the package
|
|
9
|
+
* …
|
|
10
|
+
* ### Wrap the layout
|
|
11
|
+
* …
|
|
12
|
+
* </Steps>
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
export declare function Steps({ className, children }: {
|
|
16
|
+
className?: string;
|
|
17
|
+
children: ReactNode;
|
|
18
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { cn } from "../lib/cn.js";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
// src/components/steps.tsx
|
|
4
|
+
/**
|
|
5
|
+
* Numbered steps along a line. Each `###` heading inside starts a step, so steps keep their
|
|
6
|
+
* anchors and show up in the table of contents like any other heading.
|
|
7
|
+
*
|
|
8
|
+
* ```mdx
|
|
9
|
+
* <Steps>
|
|
10
|
+
* ### Install the package
|
|
11
|
+
* …
|
|
12
|
+
* ### Wrap the layout
|
|
13
|
+
* …
|
|
14
|
+
* </Steps>
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
function Steps({ className, children }) {
|
|
18
|
+
return /* @__PURE__ */ jsx("div", {
|
|
19
|
+
className: cn("docs-steps docs-prose", className),
|
|
20
|
+
children
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
export { Steps };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useTheme } from "@wrksz/themes/client";
|
|
3
|
+
import { useState } from "react";
|
|
4
|
+
import { cn } from "../lib/cn.js";
|
|
5
|
+
import { MoonIcon, SunIcon } from "./icons.js";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
// src/components/theme-switch.tsx
|
|
8
|
+
const sunAtRest = "scale-[0.25] opacity-0 blur-xs dark:scale-100 dark:opacity-100 dark:blur-none";
|
|
9
|
+
const moonAtRest = "dark:scale-[0.25] dark:opacity-0 dark:blur-xs";
|
|
10
|
+
const enter = "animate-[icon-in_300ms_cubic-bezier(0.2,0,0,1)_both]";
|
|
11
|
+
const leave = "animate-[icon-out_300ms_cubic-bezier(0.2,0,0,1)_both]";
|
|
12
|
+
function ThemeSwitch({ className }) {
|
|
13
|
+
const { resolvedTheme, setTheme } = useTheme();
|
|
14
|
+
const [switched, setSwitched] = useState(false);
|
|
15
|
+
const dark = resolvedTheme === "dark";
|
|
16
|
+
const light = resolvedTheme === "light";
|
|
17
|
+
const label = dark ? "Switch to light theme" : "Switch to dark theme";
|
|
18
|
+
return /* @__PURE__ */ jsxs("button", {
|
|
19
|
+
type: "button",
|
|
20
|
+
"data-theme-toggle": "",
|
|
21
|
+
onClick: () => {
|
|
22
|
+
setSwitched(true);
|
|
23
|
+
setTheme(dark ? "light" : "dark");
|
|
24
|
+
},
|
|
25
|
+
"aria-label": label,
|
|
26
|
+
title: label,
|
|
27
|
+
className: cn("relative flex size-8 shrink-0 items-center justify-center rounded-[9px] text-fd-muted-foreground outline-none transition-[color,background-color,scale] duration-150 ease-out hover:bg-fd-accent hover:text-fd-foreground focus-visible:ring-2 focus-visible:ring-fd-ring active:scale-[0.96]", className),
|
|
28
|
+
children: [/* @__PURE__ */ jsx(SunIcon, { className: cn("absolute size-4", switched ? dark ? enter : leave : sunAtRest) }), /* @__PURE__ */ jsx(MoonIcon, { className: cn("absolute size-4", switched ? light ? enter : leave : moonAtRest) })]
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
export { ThemeSwitch };
|