@fumadocs/base-ui 16.9.2 → 16.10.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/css/generated/docs.css +1 -234
- package/css/generated/flux.css +1 -162
- package/css/generated/home.css +1 -65
- package/css/generated/notebook.css +1 -258
- package/css/generated/shared.css +1 -1189
- package/dist/.translations/index.d.ts +49 -0
- package/dist/.translations/keys.js +49 -0
- package/dist/components/accordion.d.ts +2 -3
- package/dist/components/accordion.js +3 -3
- package/dist/components/banner.d.ts +1 -2
- package/dist/components/banner.js +3 -3
- package/dist/components/callout.d.ts +4 -5
- package/dist/components/card.d.ts +2 -3
- package/dist/components/codeblock.d.ts +6 -7
- package/dist/components/codeblock.js +3 -3
- package/dist/components/codeblock.rsc.d.ts +1 -2
- package/dist/components/dialog/search-algolia.d.ts +1 -2
- package/dist/components/dialog/search-default.d.ts +1 -2
- package/dist/components/dialog/search-orama.d.ts +1 -2
- package/dist/components/dialog/search.d.ts +12 -13
- package/dist/components/dialog/search.js +13 -10
- package/dist/components/dynamic-codeblock.core.d.ts +1 -2
- package/dist/components/dynamic-codeblock.d.ts +1 -2
- package/dist/components/github-info.d.ts +1 -2
- package/dist/components/heading.d.ts +1 -2
- package/dist/components/heading.js +3 -3
- package/dist/components/image-zoom.d.ts +2 -3
- package/dist/components/image-zoom.js +1 -1
- package/dist/components/inline-toc.d.ts +1 -2
- package/dist/components/inline-toc.js +3 -3
- package/dist/components/sidebar/base.d.ts +13 -15
- package/dist/components/sidebar/base.js +3 -3
- package/dist/components/sidebar/link-item.d.ts +1 -2
- package/dist/components/sidebar/page-tree.d.ts +1 -2
- package/dist/components/sidebar/tabs/dropdown.d.ts +1 -2
- package/dist/components/steps.d.ts +2 -3
- package/dist/components/tabs.d.ts +5 -6
- package/dist/components/toc/clerk.d.ts +3 -4
- package/dist/components/toc/clerk.js +7 -7
- package/dist/components/toc/default.d.ts +3 -4
- package/dist/components/toc/default.js +2 -2
- package/dist/components/toc/index.d.ts +2 -3
- package/dist/components/type-table.d.ts +1 -2
- package/dist/components/type-table.js +9 -9
- package/dist/components/ui/accordion.d.ts +5 -6
- package/dist/components/ui/button.d.ts +1 -2
- package/dist/components/ui/collapsible.d.ts +3 -6
- package/dist/components/ui/navigation-menu.d.ts +6 -8
- package/dist/components/ui/popover.d.ts +2 -4
- package/dist/components/ui/scroll-area.d.ts +3 -4
- package/dist/components/ui/tabs.d.ts +4 -7
- package/dist/contexts/i18n.d.ts +5 -30
- package/dist/contexts/i18n.js +10 -22
- package/dist/contexts/search.d.ts +1 -2
- package/dist/contexts/tree.d.ts +1 -2
- package/dist/i18n.d.ts +9 -63
- package/dist/i18n.js +23 -70
- package/dist/layouts/docs/index.d.ts +1 -2
- package/dist/layouts/docs/page/index.d.ts +6 -7
- package/dist/layouts/docs/page/index.js +5 -4
- package/dist/layouts/docs/page/slots/breadcrumb.d.ts +1 -2
- package/dist/layouts/docs/page/slots/container.d.ts +1 -2
- package/dist/layouts/docs/page/slots/footer.d.ts +1 -2
- package/dist/layouts/docs/page/slots/footer.js +3 -3
- package/dist/layouts/docs/page/slots/toc.d.ts +3 -4
- package/dist/layouts/docs/page/slots/toc.js +5 -4
- package/dist/layouts/docs/slots/container.d.ts +1 -2
- package/dist/layouts/docs/slots/header.d.ts +1 -3
- package/dist/layouts/docs/slots/sidebar.d.ts +3 -4
- package/dist/layouts/flux/index.d.ts +3 -4
- package/dist/layouts/flux/page/index.d.ts +6 -7
- package/dist/layouts/flux/page/index.js +5 -4
- package/dist/layouts/flux/page/slots/breadcrumb.d.ts +1 -2
- package/dist/layouts/flux/page/slots/container.d.ts +1 -2
- package/dist/layouts/flux/page/slots/footer.d.ts +1 -2
- package/dist/layouts/flux/page/slots/footer.js +3 -3
- package/dist/layouts/flux/page/slots/toc.d.ts +1 -2
- package/dist/layouts/flux/page/slots/toc.js +3 -3
- package/dist/layouts/flux/slots/container.d.ts +1 -2
- package/dist/layouts/flux/slots/sidebar.d.ts +3 -4
- package/dist/layouts/flux/slots/tab-dropdown.d.ts +1 -2
- package/dist/layouts/home/index.d.ts +1 -2
- package/dist/layouts/home/navbar.d.ts +3 -4
- package/dist/layouts/home/not-found.d.ts +1 -3
- package/dist/layouts/home/not-found.js +6 -4
- package/dist/layouts/home/slots/container.d.ts +1 -2
- package/dist/layouts/home/slots/header.d.ts +3 -5
- package/dist/layouts/home/slots/header.js +3 -3
- package/dist/layouts/notebook/index.d.ts +1 -2
- package/dist/layouts/notebook/page/index.d.ts +6 -7
- package/dist/layouts/notebook/page/index.js +5 -4
- package/dist/layouts/notebook/page/slots/breadcrumb.d.ts +1 -2
- package/dist/layouts/notebook/page/slots/container.d.ts +1 -2
- package/dist/layouts/notebook/page/slots/footer.d.ts +1 -2
- package/dist/layouts/notebook/page/slots/footer.js +3 -3
- package/dist/layouts/notebook/page/slots/toc.d.ts +3 -4
- package/dist/layouts/notebook/page/slots/toc.js +5 -4
- package/dist/layouts/notebook/slots/container.d.ts +1 -2
- package/dist/layouts/notebook/slots/header.d.ts +1 -3
- package/dist/layouts/notebook/slots/sidebar.d.ts +5 -6
- package/dist/layouts/shared/client.d.ts +1 -2
- package/dist/layouts/shared/index.d.ts +1 -1
- package/dist/layouts/shared/page-actions.d.ts +2 -3
- package/dist/layouts/shared/page-actions.js +12 -13
- package/dist/layouts/shared/slots/language-select.d.ts +1 -2
- package/dist/layouts/shared/slots/language-select.js +5 -2
- package/dist/layouts/shared/slots/search-trigger.d.ts +2 -3
- package/dist/layouts/shared/slots/search-trigger.js +5 -5
- package/dist/layouts/shared/slots/theme-switch.d.ts +1 -2
- package/dist/layouts/shared/slots/theme-switch.js +43 -30
- package/dist/mdx.d.ts +9 -10
- package/dist/node_modules/.pnpm/{react-medium-image-zoom@5.4.5_react-dom@19.2.6_react@19.2.6__react@19.2.6 → react-medium-image-zoom@5.4.6_react-dom@19.2.7_react@19.2.7__react@19.2.7}/node_modules/react-medium-image-zoom/dist/controlled.d.ts +1 -1
- package/dist/node_modules/.pnpm/{react-medium-image-zoom@5.4.5_react-dom@19.2.6_react@19.2.6__react@19.2.6 → react-medium-image-zoom@5.4.6_react-dom@19.2.7_react@19.2.7__react@19.2.7}/node_modules/react-medium-image-zoom/dist/controlled.js +6 -2
- package/dist/node_modules/.pnpm/{react-medium-image-zoom@5.4.5_react-dom@19.2.6_react@19.2.6__react@19.2.6 → react-medium-image-zoom@5.4.6_react-dom@19.2.7_react@19.2.7__react@19.2.7}/node_modules/react-medium-image-zoom/dist/uncontrolled.d.ts +1 -1
- package/dist/node_modules/.pnpm/{react-medium-image-zoom@5.4.5_react-dom@19.2.6_react@19.2.6__react@19.2.6 → react-medium-image-zoom@5.4.6_react-dom@19.2.7_react@19.2.7__react@19.2.7}/node_modules/react-medium-image-zoom/dist/uncontrolled.js +1 -1
- package/dist/node_modules/.pnpm/{react-medium-image-zoom@5.4.5_react-dom@19.2.6_react@19.2.6__react@19.2.6 → react-medium-image-zoom@5.4.6_react-dom@19.2.7_react@19.2.7__react@19.2.7}/node_modules/react-medium-image-zoom/dist/utils/adjust-svg-ids.js +1 -1
- package/dist/node_modules/.pnpm/{react-medium-image-zoom@5.4.5_react-dom@19.2.6_react@19.2.6__react@19.2.6 → react-medium-image-zoom@5.4.6_react-dom@19.2.7_react@19.2.7__react@19.2.7}/node_modules/react-medium-image-zoom/dist/utils/compute-positioned-style.js +1 -1
- package/dist/node_modules/.pnpm/{react-medium-image-zoom@5.4.5_react-dom@19.2.6_react@19.2.6__react@19.2.6 → react-medium-image-zoom@5.4.6_react-dom@19.2.7_react@19.2.7__react@19.2.7}/node_modules/react-medium-image-zoom/dist/utils/element-tests.js +1 -1
- package/dist/node_modules/.pnpm/{react-medium-image-zoom@5.4.5_react-dom@19.2.6_react@19.2.6__react@19.2.6 → react-medium-image-zoom@5.4.6_react-dom@19.2.7_react@19.2.7__react@19.2.7}/node_modules/react-medium-image-zoom/dist/utils/get-div-img-style.js +1 -1
- package/dist/node_modules/.pnpm/{react-medium-image-zoom@5.4.5_react-dom@19.2.6_react@19.2.6__react@19.2.6 → react-medium-image-zoom@5.4.6_react-dom@19.2.7_react@19.2.7__react@19.2.7}/node_modules/react-medium-image-zoom/dist/utils/get-img-alt.js +1 -1
- package/dist/node_modules/.pnpm/{react-medium-image-zoom@5.4.5_react-dom@19.2.6_react@19.2.6__react@19.2.6 → react-medium-image-zoom@5.4.6_react-dom@19.2.7_react@19.2.7__react@19.2.7}/node_modules/react-medium-image-zoom/dist/utils/get-img-object-fit-style.js +1 -1
- package/dist/node_modules/.pnpm/{react-medium-image-zoom@5.4.5_react-dom@19.2.6_react@19.2.6__react@19.2.6 → react-medium-image-zoom@5.4.6_react-dom@19.2.7_react@19.2.7__react@19.2.7}/node_modules/react-medium-image-zoom/dist/utils/get-img-regular-style.js +1 -1
- package/dist/node_modules/.pnpm/{react-medium-image-zoom@5.4.5_react-dom@19.2.6_react@19.2.6__react@19.2.6 → react-medium-image-zoom@5.4.6_react-dom@19.2.7_react@19.2.7__react@19.2.7}/node_modules/react-medium-image-zoom/dist/utils/get-img-src.js +1 -1
- package/dist/node_modules/.pnpm/{react-medium-image-zoom@5.4.5_react-dom@19.2.6_react@19.2.6__react@19.2.6 → react-medium-image-zoom@5.4.6_react-dom@19.2.7_react@19.2.7__react@19.2.7}/node_modules/react-medium-image-zoom/dist/utils/get-modal-img-transform.js +1 -1
- package/dist/node_modules/.pnpm/{react-medium-image-zoom@5.4.5_react-dom@19.2.6_react@19.2.6__react@19.2.6 → react-medium-image-zoom@5.4.6_react-dom@19.2.7_react@19.2.7__react@19.2.7}/node_modules/react-medium-image-zoom/dist/utils/get-scale.js +1 -1
- package/dist/node_modules/.pnpm/{react-medium-image-zoom@5.4.5_react-dom@19.2.6_react@19.2.6__react@19.2.6 → react-medium-image-zoom@5.4.6_react-dom@19.2.7_react@19.2.7__react@19.2.7}/node_modules/react-medium-image-zoom/dist/utils/get-style-ghost.js +1 -1
- package/dist/node_modules/.pnpm/{react-medium-image-zoom@5.4.5_react-dom@19.2.6_react@19.2.6__react@19.2.6 → react-medium-image-zoom@5.4.6_react-dom@19.2.7_react@19.2.7__react@19.2.7}/node_modules/react-medium-image-zoom/dist/utils/get-style-modal-img.js +1 -1
- package/dist/node_modules/.pnpm/{react-medium-image-zoom@5.4.5_react-dom@19.2.6_react@19.2.6__react@19.2.6 → react-medium-image-zoom@5.4.6_react-dom@19.2.7_react@19.2.7__react@19.2.7}/node_modules/react-medium-image-zoom/dist/utils/get-target-dimension.js +1 -1
- package/dist/node_modules/.pnpm/{react-medium-image-zoom@5.4.5_react-dom@19.2.6_react@19.2.6__react@19.2.6 → react-medium-image-zoom@5.4.6_react-dom@19.2.7_react@19.2.7__react@19.2.7}/node_modules/react-medium-image-zoom/dist/utils/parse-position.js +1 -1
- package/dist/node_modules/.pnpm/{react-medium-image-zoom@5.4.5_react-dom@19.2.6_react@19.2.6__react@19.2.6 → react-medium-image-zoom@5.4.6_react-dom@19.2.7_react@19.2.7__react@19.2.7}/node_modules/react-medium-image-zoom/dist/utils/test-has-scalable-src.js +1 -1
- package/dist/og/takumi.d.ts +1 -2
- package/dist/og.d.ts +1 -2
- package/dist/page.d.ts +2 -3
- package/dist/provider/base.d.ts +1 -2
- package/dist/provider/next.d.ts +1 -2
- package/dist/provider/react-router.d.ts +1 -2
- package/dist/provider/tanstack.d.ts +1 -2
- package/dist/provider/waku.d.ts +1 -2
- package/dist/style.css +3 -0
- package/package.json +11 -10
- /package/dist/node_modules/.pnpm/{react-medium-image-zoom@5.4.5_react-dom@19.2.6_react@19.2.6__react@19.2.6 → react-medium-image-zoom@5.4.6_react-dom@19.2.7_react@19.2.7__react@19.2.7}/node_modules/react-medium-image-zoom/dist/index.d.ts +0 -0
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn } from "../../../../utils/cn.js";
|
|
3
|
-
import { useTranslations } from "../../../../contexts/i18n.js";
|
|
4
3
|
import { isActive } from "../../../../utils/urls.js";
|
|
5
4
|
import { useFooterItems } from "../../../../utils/use-footer-items.js";
|
|
6
5
|
import Link from "fumadocs-core/link";
|
|
@@ -8,6 +7,7 @@ import { usePathname } from "fumadocs-core/framework";
|
|
|
8
7
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
9
8
|
import { ChevronLeft, ChevronRight } from "lucide-react";
|
|
10
9
|
import { useMemo } from "react";
|
|
10
|
+
import { useTranslations } from "@fuma-translate/react";
|
|
11
11
|
//#region src/layouts/notebook/page/slots/footer.tsx
|
|
12
12
|
function Footer({ items, children, className, ...props }) {
|
|
13
13
|
const footerList = useFooterItems();
|
|
@@ -38,7 +38,7 @@ function Footer({ items, children, className, ...props }) {
|
|
|
38
38
|
}), children] });
|
|
39
39
|
}
|
|
40
40
|
function FooterItem({ item, index }) {
|
|
41
|
-
const t = useTranslations();
|
|
41
|
+
const t = useTranslations({ note: "pagination" });
|
|
42
42
|
const Icon = index === 0 ? ChevronLeft : ChevronRight;
|
|
43
43
|
return /* @__PURE__ */ jsxs(Link, {
|
|
44
44
|
href: item.url,
|
|
@@ -48,7 +48,7 @@ function FooterItem({ item, index }) {
|
|
|
48
48
|
children: [/* @__PURE__ */ jsx(Icon, { className: "-mx-1 size-4 shrink-0 rtl:rotate-180" }), /* @__PURE__ */ jsx("p", { children: item.name })]
|
|
49
49
|
}), /* @__PURE__ */ jsx("p", {
|
|
50
50
|
className: "text-fd-muted-foreground truncate",
|
|
51
|
-
children: item.description ?? (index === 0 ? t
|
|
51
|
+
children: item.description ?? (index === 0 ? t("Previous Page") : t("Next Page"))
|
|
52
52
|
})]
|
|
53
53
|
});
|
|
54
54
|
}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { TOCItemsProps } from "../../../../components/toc/clerk.js";
|
|
2
2
|
import { TOCItemsProps as TOCItemsProps$1 } from "../../../../components/toc/default.js";
|
|
3
3
|
import { TOCProviderProps as TOCProviderProps$1 } from "../../../../components/toc/index.js";
|
|
4
|
-
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
5
4
|
import { ComponentProps, ReactNode } from "react";
|
|
6
5
|
|
|
7
6
|
//#region src/layouts/notebook/page/slots/toc.d.ts
|
|
8
7
|
type TOCProviderProps = TOCProviderProps$1;
|
|
9
|
-
declare function TOCProvider(props: TOCProviderProps):
|
|
8
|
+
declare function TOCProvider(props: TOCProviderProps): import("react").JSX.Element;
|
|
10
9
|
type TOCProps = {
|
|
11
10
|
container?: ComponentProps<'div'>;
|
|
12
11
|
/**
|
|
@@ -30,7 +29,7 @@ declare function TOC({
|
|
|
30
29
|
footer,
|
|
31
30
|
style,
|
|
32
31
|
list
|
|
33
|
-
}: TOCProps):
|
|
32
|
+
}: TOCProps): import("react").JSX.Element;
|
|
34
33
|
type TOCPopoverProps = {
|
|
35
34
|
container?: ComponentProps<'div'>;
|
|
36
35
|
trigger?: ComponentProps<'button'>;
|
|
@@ -58,6 +57,6 @@ declare function TOCPopover({
|
|
|
58
57
|
footer,
|
|
59
58
|
style,
|
|
60
59
|
list
|
|
61
|
-
}: TOCPopoverProps):
|
|
60
|
+
}: TOCPopoverProps): import("react").JSX.Element;
|
|
62
61
|
//#endregion
|
|
63
62
|
export { TOC, TOCPopover, TOCPopoverProps, TOCProps, TOCProvider, TOCProviderProps };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn } from "../../../../utils/cn.js";
|
|
3
|
-
import { I18nLabel, useTranslations } from "../../../../contexts/i18n.js";
|
|
4
3
|
import { TOCProvider as TOCProvider$1, TOCScrollArea, useItems, useTOCItems } from "../../../../components/toc/index.js";
|
|
5
4
|
import { default_exports } from "../../../../components/toc/default.js";
|
|
6
5
|
import { clerk_exports } from "../../../../components/toc/clerk.js";
|
|
@@ -10,11 +9,13 @@ import { useNotebookLayout } from "../../client.js";
|
|
|
10
9
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
11
10
|
import { ChevronDown, Text } from "lucide-react";
|
|
12
11
|
import { createContext, use, useEffect, useEffectEvent, useMemo, useRef, useState } from "react";
|
|
12
|
+
import { useTranslations } from "@fuma-translate/react";
|
|
13
13
|
//#region src/layouts/notebook/page/slots/toc.tsx
|
|
14
14
|
function TOCProvider(props) {
|
|
15
15
|
return /* @__PURE__ */ jsx(TOCProvider$1, { ...props });
|
|
16
16
|
}
|
|
17
17
|
function TOC({ container, header, footer, style = "normal", list }) {
|
|
18
|
+
const t = useTranslations({ note: "table of contents" });
|
|
18
19
|
const items = useTOCItems();
|
|
19
20
|
const { TOCItems, TOCEmpty, TOCItem } = style === "clerk" ? clerk_exports : default_exports;
|
|
20
21
|
if (items.length === 0 && !footer && !header) return /* @__PURE__ */ jsx("div", {
|
|
@@ -30,7 +31,7 @@ function TOC({ container, header, footer, style = "normal", list }) {
|
|
|
30
31
|
/* @__PURE__ */ jsxs("h3", {
|
|
31
32
|
id: "toc-title",
|
|
32
33
|
className: "inline-flex items-center gap-1.5 text-sm text-fd-muted-foreground",
|
|
33
|
-
children: [/* @__PURE__ */ jsx(Text, { className: "size-4" }),
|
|
34
|
+
children: [/* @__PURE__ */ jsx(Text, { className: "size-4" }), t("On this page")]
|
|
34
35
|
}),
|
|
35
36
|
/* @__PURE__ */ jsx(TOCScrollArea, { children: /* @__PURE__ */ jsxs(TOCItems, {
|
|
36
37
|
...list,
|
|
@@ -93,7 +94,7 @@ function TOCPopover({ container, trigger, content, header, footer, style = "norm
|
|
|
93
94
|
});
|
|
94
95
|
}
|
|
95
96
|
function PageTOCPopoverTrigger({ className, ...props }) {
|
|
96
|
-
const t = useTranslations();
|
|
97
|
+
const t = useTranslations({ note: "table of contents" });
|
|
97
98
|
const { open } = use(TocPopoverContext);
|
|
98
99
|
const items = useItems();
|
|
99
100
|
const selectedIdx = items.findIndex((item) => item.active);
|
|
@@ -113,7 +114,7 @@ function PageTOCPopoverTrigger({ className, ...props }) {
|
|
|
113
114
|
className: "grid flex-1 *:my-auto *:row-start-1 *:col-start-1",
|
|
114
115
|
children: [/* @__PURE__ */ jsx("span", {
|
|
115
116
|
className: cn("truncate transition-[opacity,translate,color]", open && "text-fd-foreground", showItem && "opacity-0 -translate-y-full pointer-events-none"),
|
|
116
|
-
children: path?.name ?? t
|
|
117
|
+
children: path?.name ?? t("On this page")
|
|
117
118
|
}), /* @__PURE__ */ jsx("span", {
|
|
118
119
|
className: cn("truncate transition-[opacity,translate]", !showItem && "opacity-0 translate-y-full pointer-events-none"),
|
|
119
120
|
children: items[selectedIdx]?.original.title
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
2
1
|
import { ComponentProps } from "react";
|
|
3
2
|
|
|
4
3
|
//#region src/layouts/notebook/slots/container.d.ts
|
|
5
|
-
declare function Container(props: ComponentProps<'div'>):
|
|
4
|
+
declare function Container(props: ComponentProps<'div'>): import("react").JSX.Element;
|
|
6
5
|
//#endregion
|
|
7
6
|
export { Container };
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
2
|
-
import * as _$react from "react";
|
|
3
1
|
import { ComponentProps } from "react";
|
|
4
2
|
|
|
5
3
|
//#region src/layouts/notebook/slots/header.d.ts
|
|
6
|
-
declare function Header(props: ComponentProps<'header'>): string | number | bigint | true |
|
|
4
|
+
declare function Header(props: ComponentProps<'header'>): string | number | bigint | true | import("react").JSX.Element | Iterable<import("react").ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<import("react").ReactNode> | null | undefined>;
|
|
7
5
|
//#endregion
|
|
8
6
|
export { Header };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { SidebarProviderProps as SidebarProviderProps$1, useSidebar as useSidebar$1 } from "../../../components/sidebar/base.js";
|
|
2
2
|
import { LayoutTab } from "../../shared/index.js";
|
|
3
3
|
import { SidebarPageTreeComponents } from "../../../components/sidebar/page-tree.js";
|
|
4
|
-
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
5
4
|
import { ComponentProps, FC, ReactNode } from "react";
|
|
6
5
|
|
|
7
6
|
//#region src/layouts/notebook/slots/sidebar.d.ts
|
|
@@ -18,16 +17,16 @@ interface SidebarProps extends ComponentProps<'aside'> {
|
|
|
18
17
|
}
|
|
19
18
|
type SidebarProviderProps = SidebarProviderProps$1;
|
|
20
19
|
declare const useSidebar: typeof useSidebar$1;
|
|
21
|
-
declare function SidebarProvider(props: SidebarProviderProps):
|
|
22
|
-
declare function SidebarTrigger(props: ComponentProps<'button'>):
|
|
23
|
-
declare function SidebarCollapseTrigger(props: ComponentProps<'button'>):
|
|
20
|
+
declare function SidebarProvider(props: SidebarProviderProps): import("react").JSX.Element;
|
|
21
|
+
declare function SidebarTrigger(props: ComponentProps<'button'>): import("react").JSX.Element;
|
|
22
|
+
declare function SidebarCollapseTrigger(props: ComponentProps<'button'>): import("react").JSX.Element;
|
|
24
23
|
declare function Sidebar({
|
|
25
24
|
banner,
|
|
26
25
|
footer,
|
|
27
26
|
components,
|
|
28
27
|
collapsible,
|
|
29
28
|
...rest
|
|
30
|
-
}: SidebarProps):
|
|
29
|
+
}: SidebarProps): import("react").JSX.Element;
|
|
31
30
|
declare function SidebarTabsDropdown({
|
|
32
31
|
options,
|
|
33
32
|
placeholder,
|
|
@@ -35,6 +34,6 @@ declare function SidebarTabsDropdown({
|
|
|
35
34
|
}: {
|
|
36
35
|
placeholder?: ReactNode;
|
|
37
36
|
options: LayoutTab[];
|
|
38
|
-
} & ComponentProps<'button'>):
|
|
37
|
+
} & ComponentProps<'button'>): import("react").JSX.Element;
|
|
39
38
|
//#endregion
|
|
40
39
|
export { Sidebar, SidebarCollapseTrigger, SidebarProps, SidebarProvider, SidebarProviderProps, SidebarTabsDropdown, SidebarTrigger, useSidebar };
|
|
@@ -2,7 +2,6 @@ import { LanguageSelectProps, LanguageSelectTextProps } from "./slots/language-s
|
|
|
2
2
|
import { FullSearchTriggerProps, SearchTriggerProps } from "./slots/search-trigger.js";
|
|
3
3
|
import { ThemeSwitchProps } from "./slots/theme-switch.js";
|
|
4
4
|
import { BaseLayoutProps, LinkItemType } from "./index.js";
|
|
5
|
-
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
6
5
|
import { ComponentProps, FC } from "react";
|
|
7
6
|
|
|
8
7
|
//#region src/layouts/shared/client.d.ts
|
|
@@ -14,7 +13,7 @@ declare function LinkItem({
|
|
|
14
13
|
item: Extract<LinkItemType, {
|
|
15
14
|
url: string;
|
|
16
15
|
}>;
|
|
17
|
-
}):
|
|
16
|
+
}): import("react").JSX.Element;
|
|
18
17
|
interface BaseSlots {
|
|
19
18
|
navTitle: FC<ComponentProps<'a'>>;
|
|
20
19
|
themeSwitch: FC<ThemeSwitchProps> | false;
|
|
@@ -2,8 +2,8 @@ import { FullSearchTriggerProps, SearchTriggerProps } from "./slots/search-trigg
|
|
|
2
2
|
import { ThemeSwitchProps } from "./slots/theme-switch.js";
|
|
3
3
|
import { BaseSlots, BaseSlotsProps, LinkItem, baseSlots } from "./client.js";
|
|
4
4
|
import { ComponentProps, FC, ReactNode } from "react";
|
|
5
|
-
import { I18nConfig } from "fumadocs-core/i18n";
|
|
6
5
|
import * as PageTree from "fumadocs-core/page-tree";
|
|
6
|
+
import { I18nConfig } from "fumadocs-core/i18n";
|
|
7
7
|
|
|
8
8
|
//#region src/layouts/shared/index.d.ts
|
|
9
9
|
interface NavOptions {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { PopoverTrigger } from "../../components/ui/popover.js";
|
|
2
|
-
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
2
|
import { ComponentProps } from "react";
|
|
4
3
|
|
|
5
4
|
//#region src/layouts/shared/page-actions.d.ts
|
|
@@ -14,7 +13,7 @@ declare function MarkdownCopyButton({
|
|
|
14
13
|
* A URL to fetch the raw Markdown/MDX content of page
|
|
15
14
|
*/
|
|
16
15
|
markdownUrl: string;
|
|
17
|
-
}):
|
|
16
|
+
}): import("react").JSX.Element;
|
|
18
17
|
/**
|
|
19
18
|
* see https://fumadocs.dev/docs/integrations/llms#page-actions to customize.
|
|
20
19
|
*/
|
|
@@ -31,6 +30,6 @@ declare function ViewOptionsPopover({
|
|
|
31
30
|
* Source file URL on GitHub
|
|
32
31
|
*/
|
|
33
32
|
githubUrl?: string;
|
|
34
|
-
}):
|
|
33
|
+
}): import("react").JSX.Element;
|
|
35
34
|
//#endregion
|
|
36
35
|
export { MarkdownCopyButton, ViewOptionsPopover };
|
|
@@ -2,20 +2,19 @@
|
|
|
2
2
|
import { cn } from "../../utils/cn.js";
|
|
3
3
|
import { buttonVariants } from "../../components/ui/button.js";
|
|
4
4
|
import { useCopyButton } from "../../utils/use-copy-button.js";
|
|
5
|
-
import { useTranslations } from "../../contexts/i18n.js";
|
|
6
5
|
import { Popover, PopoverContent, PopoverTrigger } from "../../components/ui/popover.js";
|
|
7
6
|
import { usePathname } from "fumadocs-core/framework";
|
|
8
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
8
|
import { Check, ChevronDown, Copy, ExternalLinkIcon, TextIcon } from "lucide-react";
|
|
10
9
|
import { useMemo, useState } from "react";
|
|
11
|
-
import {
|
|
10
|
+
import { useTranslations } from "@fuma-translate/react";
|
|
12
11
|
//#region src/layouts/shared/page-actions.tsx
|
|
13
12
|
const cache = /* @__PURE__ */ new Map();
|
|
14
13
|
/**
|
|
15
14
|
* see https://fumadocs.dev/docs/integrations/llms#page-actions to customize.
|
|
16
15
|
*/
|
|
17
16
|
function MarkdownCopyButton({ markdownUrl, ...props }) {
|
|
18
|
-
const t = useTranslations();
|
|
17
|
+
const t = useTranslations({ note: "page actions" });
|
|
19
18
|
const [isLoading, setLoading] = useState(false);
|
|
20
19
|
const [checked, onClick] = useCopyButton(async () => {
|
|
21
20
|
const cached = cache.get(markdownUrl);
|
|
@@ -38,7 +37,7 @@ function MarkdownCopyButton({ markdownUrl, ...props }) {
|
|
|
38
37
|
size: "sm",
|
|
39
38
|
className: "gap-2 [&_svg]:size-3.5 [&_svg]:text-fd-muted-foreground"
|
|
40
39
|
}), props.className),
|
|
41
|
-
children: [checked ? /* @__PURE__ */ jsx(Check, {}) : /* @__PURE__ */ jsx(Copy, {}), props.children ?? t
|
|
40
|
+
children: [checked ? /* @__PURE__ */ jsx(Check, {}) : /* @__PURE__ */ jsx(Copy, {}), props.children ?? t("Copy Markdown")]
|
|
42
41
|
});
|
|
43
42
|
}
|
|
44
43
|
/**
|
|
@@ -46,13 +45,13 @@ function MarkdownCopyButton({ markdownUrl, ...props }) {
|
|
|
46
45
|
*/
|
|
47
46
|
function ViewOptionsPopover({ markdownUrl, githubUrl, ...props }) {
|
|
48
47
|
const pathname = usePathname();
|
|
49
|
-
const t = useTranslations();
|
|
48
|
+
const t = useTranslations({ note: "page actions" });
|
|
50
49
|
const items = useMemo(() => {
|
|
51
50
|
const pageUrl = typeof window === "undefined" ? pathname : new URL(pathname, window.location.origin);
|
|
52
|
-
const q =
|
|
51
|
+
const q = t("Read {url}, I want to ask questions about it.", { variables: { url: String(pageUrl) } });
|
|
53
52
|
return [
|
|
54
53
|
githubUrl && {
|
|
55
|
-
title: t
|
|
54
|
+
title: t("Open in GitHub"),
|
|
56
55
|
href: githubUrl,
|
|
57
56
|
icon: /* @__PURE__ */ jsxs("svg", {
|
|
58
57
|
fill: "currentColor",
|
|
@@ -62,12 +61,12 @@ function ViewOptionsPopover({ markdownUrl, githubUrl, ...props }) {
|
|
|
62
61
|
})
|
|
63
62
|
},
|
|
64
63
|
markdownUrl && {
|
|
65
|
-
title: t
|
|
64
|
+
title: t("View as Markdown"),
|
|
66
65
|
href: markdownUrl,
|
|
67
66
|
icon: /* @__PURE__ */ jsx(TextIcon, {})
|
|
68
67
|
},
|
|
69
68
|
{
|
|
70
|
-
title: t
|
|
69
|
+
title: t("Open in Scira AI"),
|
|
71
70
|
href: `https://scira.ai/?${new URLSearchParams({ q })}`,
|
|
72
71
|
icon: /* @__PURE__ */ jsxs("svg", {
|
|
73
72
|
width: "910",
|
|
@@ -128,7 +127,7 @@ function ViewOptionsPopover({ markdownUrl, githubUrl, ...props }) {
|
|
|
128
127
|
})
|
|
129
128
|
},
|
|
130
129
|
{
|
|
131
|
-
title: t
|
|
130
|
+
title: t("Open in ChatGPT"),
|
|
132
131
|
href: `https://chatgpt.com/?${new URLSearchParams({
|
|
133
132
|
hints: "search",
|
|
134
133
|
q
|
|
@@ -142,7 +141,7 @@ function ViewOptionsPopover({ markdownUrl, githubUrl, ...props }) {
|
|
|
142
141
|
})
|
|
143
142
|
},
|
|
144
143
|
{
|
|
145
|
-
title: t
|
|
144
|
+
title: t("Open in Claude"),
|
|
146
145
|
href: `https://claude.ai/new?${new URLSearchParams({ q })}`,
|
|
147
146
|
icon: /* @__PURE__ */ jsxs("svg", {
|
|
148
147
|
fill: "currentColor",
|
|
@@ -153,7 +152,7 @@ function ViewOptionsPopover({ markdownUrl, githubUrl, ...props }) {
|
|
|
153
152
|
})
|
|
154
153
|
},
|
|
155
154
|
{
|
|
156
|
-
title: t
|
|
155
|
+
title: t("Open in Cursor"),
|
|
157
156
|
icon: /* @__PURE__ */ jsxs("svg", {
|
|
158
157
|
fill: "currentColor",
|
|
159
158
|
role: "img",
|
|
@@ -176,7 +175,7 @@ function ViewOptionsPopover({ markdownUrl, githubUrl, ...props }) {
|
|
|
176
175
|
color: "secondary",
|
|
177
176
|
size: "sm"
|
|
178
177
|
}), "gap-2 data-[state=open]:bg-fd-accent data-[state=open]:text-fd-accent-foreground", typeof props.className === "function" ? props.className(state) : props.className),
|
|
179
|
-
children: [props.children ?? t
|
|
178
|
+
children: [props.children ?? t("Open"), /* @__PURE__ */ jsx(ChevronDown, { className: "size-3.5 text-fd-muted-foreground" })]
|
|
180
179
|
}), /* @__PURE__ */ jsx(PopoverContent, {
|
|
181
180
|
className: "flex flex-col",
|
|
182
181
|
children: items.map((item) => /* @__PURE__ */ jsxs("a", {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { buttonVariants } from "../../../components/ui/button.js";
|
|
2
|
-
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
2
|
import { VariantProps } from "class-variance-authority";
|
|
4
3
|
import { ComponentProps } from "react";
|
|
5
4
|
|
|
@@ -14,6 +13,6 @@ declare function LanguageSelect({
|
|
|
14
13
|
...rest
|
|
15
14
|
}: LanguageSelectProps): React.ReactElement;
|
|
16
15
|
type LanguageSelectTextProps = ComponentProps<'span'>;
|
|
17
|
-
declare function LanguageSelectText(props: LanguageSelectTextProps):
|
|
16
|
+
declare function LanguageSelectText(props: LanguageSelectTextProps): import("react").JSX.Element;
|
|
18
17
|
//#endregion
|
|
19
18
|
export { LanguageSelect, LanguageSelectProps, LanguageSelectText, LanguageSelectTextProps };
|
|
@@ -4,12 +4,15 @@ import { buttonVariants } from "../../../components/ui/button.js";
|
|
|
4
4
|
import { useI18n } from "../../../contexts/i18n.js";
|
|
5
5
|
import { Popover, PopoverContent, PopoverTrigger } from "../../../components/ui/popover.js";
|
|
6
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { useTranslations } from "@fuma-translate/react";
|
|
7
8
|
//#region src/layouts/shared/slots/language-select.tsx
|
|
8
9
|
function LanguageSelect({ className, variant = "ghost", children, ...rest }) {
|
|
9
10
|
const context = useI18n();
|
|
11
|
+
const t = useTranslations({ note: "language switcher" });
|
|
10
12
|
if (!context.locales) throw new Error("Missing `<I18nProvider />`");
|
|
13
|
+
const chooseLanguage = t("Choose a language");
|
|
11
14
|
return /* @__PURE__ */ jsxs(Popover, { children: [/* @__PURE__ */ jsx(PopoverTrigger, {
|
|
12
|
-
"aria-label":
|
|
15
|
+
"aria-label": t("Choose a language", { note: "aria-label" }),
|
|
13
16
|
className: (s) => cn(buttonVariants({ variant }), "gap-1.5 p-1.5", s.open && "bg-fd-accent", className),
|
|
14
17
|
...rest,
|
|
15
18
|
children
|
|
@@ -17,7 +20,7 @@ function LanguageSelect({ className, variant = "ghost", children, ...rest }) {
|
|
|
17
20
|
className: "flex flex-col gap-0.5 p-1",
|
|
18
21
|
children: [/* @__PURE__ */ jsx("p", {
|
|
19
22
|
className: "p-2 text-xs font-medium text-fd-muted-foreground",
|
|
20
|
-
children:
|
|
23
|
+
children: chooseLanguage
|
|
21
24
|
}), context.locales.map((item) => /* @__PURE__ */ jsx("button", {
|
|
22
25
|
type: "button",
|
|
23
26
|
className: cn("px-2 py-1.5 text-start text-sm rounded-lg transition-colors", item.locale === context.locale ? "bg-fd-primary/10 text-fd-primary" : "text-fd-muted-foreground hover:bg-fd-accent hover:text-fd-accent-foreground"),
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ButtonProps } from "../../../components/ui/button.js";
|
|
2
|
-
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
2
|
import { ComponentProps } from "react";
|
|
4
3
|
|
|
5
4
|
//#region src/layouts/shared/slots/search-trigger.d.ts
|
|
@@ -11,13 +10,13 @@ declare function SearchTrigger({
|
|
|
11
10
|
size,
|
|
12
11
|
color,
|
|
13
12
|
...props
|
|
14
|
-
}: SearchTriggerProps):
|
|
13
|
+
}: SearchTriggerProps): import("react").JSX.Element | null;
|
|
15
14
|
interface FullSearchTriggerProps extends ComponentProps<'button'> {
|
|
16
15
|
hideIfDisabled?: boolean;
|
|
17
16
|
}
|
|
18
17
|
declare function FullSearchTrigger({
|
|
19
18
|
hideIfDisabled,
|
|
20
19
|
...props
|
|
21
|
-
}: FullSearchTriggerProps):
|
|
20
|
+
}: FullSearchTriggerProps): import("react").JSX.Element | null;
|
|
22
21
|
//#endregion
|
|
23
22
|
export { FullSearchTrigger, FullSearchTriggerProps, SearchTrigger, SearchTriggerProps };
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn } from "../../../utils/cn.js";
|
|
3
3
|
import { buttonVariants } from "../../../components/ui/button.js";
|
|
4
|
-
import { useTranslations } from "../../../contexts/i18n.js";
|
|
5
4
|
import { useSearchContext } from "../../../contexts/search.js";
|
|
6
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
6
|
import { Search } from "lucide-react";
|
|
7
|
+
import { useTranslations } from "@fuma-translate/react";
|
|
8
8
|
//#region src/layouts/shared/slots/search-trigger.tsx
|
|
9
9
|
function SearchTrigger({ hideIfDisabled, size = "icon-sm", color = "ghost", ...props }) {
|
|
10
10
|
const { setOpenSearch, enabled } = useSearchContext();
|
|
11
|
-
const t = useTranslations();
|
|
11
|
+
const t = useTranslations({ note: "search trigger" });
|
|
12
12
|
if (hideIfDisabled && !enabled) return null;
|
|
13
13
|
return /* @__PURE__ */ jsx("button", {
|
|
14
14
|
type: "button",
|
|
@@ -17,7 +17,7 @@ function SearchTrigger({ hideIfDisabled, size = "icon-sm", color = "ghost", ...p
|
|
|
17
17
|
color
|
|
18
18
|
}), props.className),
|
|
19
19
|
"data-search": "",
|
|
20
|
-
"aria-label": t
|
|
20
|
+
"aria-label": t("Open Search", { note: "aria-label" }),
|
|
21
21
|
onClick: () => {
|
|
22
22
|
setOpenSearch(true);
|
|
23
23
|
},
|
|
@@ -26,7 +26,7 @@ function SearchTrigger({ hideIfDisabled, size = "icon-sm", color = "ghost", ...p
|
|
|
26
26
|
}
|
|
27
27
|
function FullSearchTrigger({ hideIfDisabled, ...props }) {
|
|
28
28
|
const { enabled, hotKey, setOpenSearch } = useSearchContext();
|
|
29
|
-
const t = useTranslations();
|
|
29
|
+
const t = useTranslations({ note: "search trigger" });
|
|
30
30
|
if (hideIfDisabled && !enabled) return null;
|
|
31
31
|
return /* @__PURE__ */ jsxs("button", {
|
|
32
32
|
type: "button",
|
|
@@ -38,7 +38,7 @@ function FullSearchTrigger({ hideIfDisabled, ...props }) {
|
|
|
38
38
|
},
|
|
39
39
|
children: [
|
|
40
40
|
/* @__PURE__ */ jsx(Search, { className: "size-4" }),
|
|
41
|
-
t
|
|
41
|
+
t("Search"),
|
|
42
42
|
/* @__PURE__ */ jsx("div", {
|
|
43
43
|
className: "ms-auto inline-flex gap-0.5",
|
|
44
44
|
children: hotKey.map((k, i) => /* @__PURE__ */ jsx("kbd", {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
2
1
|
import { ComponentProps } from "react";
|
|
3
2
|
|
|
4
3
|
//#region src/layouts/shared/slots/theme-switch.d.ts
|
|
@@ -9,6 +8,6 @@ declare function ThemeSwitch({
|
|
|
9
8
|
className,
|
|
10
9
|
mode,
|
|
11
10
|
...props
|
|
12
|
-
}: ThemeSwitchProps):
|
|
11
|
+
}: ThemeSwitchProps): import("react").JSX.Element;
|
|
13
12
|
//#endregion
|
|
14
13
|
export { ThemeSwitch, ThemeSwitchProps };
|
|
@@ -1,37 +1,30 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn } from "../../../utils/cn.js";
|
|
3
|
-
import {
|
|
4
|
-
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
4
|
import { Airplay, Moon, Sun } from "lucide-react";
|
|
6
5
|
import { cva } from "class-variance-authority";
|
|
7
6
|
import { useEffect, useState } from "react";
|
|
7
|
+
import { useTranslations } from "@fuma-translate/react";
|
|
8
8
|
import { useTheme } from "next-themes";
|
|
9
9
|
//#region src/layouts/shared/slots/theme-switch.tsx
|
|
10
10
|
const itemVariants = cva("size-6.5 p-1.5 text-fd-muted-foreground", { variants: { active: {
|
|
11
11
|
true: "bg-fd-accent text-fd-accent-foreground",
|
|
12
12
|
false: "text-fd-muted-foreground"
|
|
13
13
|
} } });
|
|
14
|
-
const
|
|
15
|
-
[
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
"themeLight"
|
|
19
|
-
],
|
|
20
|
-
[
|
|
21
|
-
"dark",
|
|
22
|
-
Moon,
|
|
23
|
-
"themeDark"
|
|
24
|
-
],
|
|
25
|
-
[
|
|
26
|
-
"system",
|
|
27
|
-
Airplay,
|
|
28
|
-
"themeSystem"
|
|
29
|
-
]
|
|
14
|
+
const themes = [
|
|
15
|
+
["light", Sun],
|
|
16
|
+
["dark", Moon],
|
|
17
|
+
["system", Airplay]
|
|
30
18
|
];
|
|
31
19
|
function ThemeSwitch({ className, mode = "light-dark", ...props }) {
|
|
32
20
|
const { setTheme, theme, resolvedTheme } = useTheme();
|
|
33
21
|
const [mounted, setMounted] = useState(false);
|
|
34
|
-
const t = useTranslations();
|
|
22
|
+
const t = useTranslations({ note: "theme switcher" });
|
|
23
|
+
const themeAriaLabels = {
|
|
24
|
+
light: t("Light", { note: "aria-label" }),
|
|
25
|
+
dark: t("Dark", { note: "aria-label" }),
|
|
26
|
+
system: t("System", { note: "aria-label" })
|
|
27
|
+
};
|
|
35
28
|
useEffect(() => {
|
|
36
29
|
setMounted(true);
|
|
37
30
|
}, []);
|
|
@@ -40,10 +33,10 @@ function ThemeSwitch({ className, mode = "light-dark", ...props }) {
|
|
|
40
33
|
const value = mounted ? resolvedTheme : null;
|
|
41
34
|
return /* @__PURE__ */ jsx("button", {
|
|
42
35
|
className: container,
|
|
43
|
-
"aria-label": t
|
|
36
|
+
"aria-label": t("Toggle Theme", { note: "aria-label" }),
|
|
44
37
|
onClick: () => setTheme(value === "light" ? "dark" : "light"),
|
|
45
38
|
"data-theme-toggle": "",
|
|
46
|
-
children:
|
|
39
|
+
children: themes.map(([key, Icon]) => {
|
|
47
40
|
if (key === "system") return;
|
|
48
41
|
return /* @__PURE__ */ jsx(Icon, {
|
|
49
42
|
fill: "currentColor",
|
|
@@ -53,19 +46,39 @@ function ThemeSwitch({ className, mode = "light-dark", ...props }) {
|
|
|
53
46
|
});
|
|
54
47
|
}
|
|
55
48
|
const value = mounted ? theme : null;
|
|
56
|
-
return /* @__PURE__ */
|
|
49
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
57
50
|
className: container,
|
|
58
51
|
"data-theme-toggle": "",
|
|
59
52
|
...props,
|
|
60
|
-
children:
|
|
61
|
-
"
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
53
|
+
children: [
|
|
54
|
+
/* @__PURE__ */ jsx("button", {
|
|
55
|
+
"aria-label": themeAriaLabels.light,
|
|
56
|
+
className: cn(itemVariants({ active: value === "light" })),
|
|
57
|
+
onClick: () => setTheme("light"),
|
|
58
|
+
children: /* @__PURE__ */ jsx(Sun, {
|
|
59
|
+
className: "size-full",
|
|
60
|
+
fill: "currentColor"
|
|
61
|
+
})
|
|
62
|
+
}),
|
|
63
|
+
/* @__PURE__ */ jsx("button", {
|
|
64
|
+
"aria-label": themeAriaLabels.dark,
|
|
65
|
+
className: cn(itemVariants({ active: value === "dark" })),
|
|
66
|
+
onClick: () => setTheme("dark"),
|
|
67
|
+
children: /* @__PURE__ */ jsx(Moon, {
|
|
68
|
+
className: "size-full",
|
|
69
|
+
fill: "currentColor"
|
|
70
|
+
})
|
|
71
|
+
}),
|
|
72
|
+
/* @__PURE__ */ jsx("button", {
|
|
73
|
+
"aria-label": themeAriaLabels.system,
|
|
74
|
+
className: cn(itemVariants({ active: value === "system" })),
|
|
75
|
+
onClick: () => setTheme("system"),
|
|
76
|
+
children: /* @__PURE__ */ jsx(Airplay, {
|
|
77
|
+
className: "size-full",
|
|
78
|
+
fill: "currentColor"
|
|
79
|
+
})
|
|
67
80
|
})
|
|
68
|
-
|
|
81
|
+
]
|
|
69
82
|
});
|
|
70
83
|
}
|
|
71
84
|
//#endregion
|
package/dist/mdx.d.ts
CHANGED
|
@@ -2,7 +2,6 @@ import { Callout, CalloutContainer, CalloutDescription, CalloutTitle } from "./c
|
|
|
2
2
|
import { Card, Cards } from "./components/card.js";
|
|
3
3
|
import { CodeBlockTab, CodeBlockTabs, CodeBlockTabsList, CodeBlockTabsTrigger } from "./components/codeblock.js";
|
|
4
4
|
import { createRelativeLink as createRelativeLink$1 } from "./mdx.server.js";
|
|
5
|
-
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
6
5
|
import React, { AnchorHTMLAttributes, FC, HTMLAttributes, ImgHTMLAttributes, TableHTMLAttributes } from "react";
|
|
7
6
|
|
|
8
7
|
//#region src/mdx.d.ts
|
|
@@ -17,24 +16,24 @@ declare module 'mdx/types.js' {
|
|
|
17
16
|
type IntrinsicElements = React.JSX.IntrinsicElements;
|
|
18
17
|
}
|
|
19
18
|
}
|
|
20
|
-
declare function Image(props: ImgHTMLAttributes<HTMLImageElement>):
|
|
21
|
-
declare function Table(props: TableHTMLAttributes<HTMLTableElement>):
|
|
19
|
+
declare function Image(props: ImgHTMLAttributes<HTMLImageElement>): React.JSX.Element;
|
|
20
|
+
declare function Table(props: TableHTMLAttributes<HTMLTableElement>): React.JSX.Element;
|
|
22
21
|
declare const defaultMdxComponents: {
|
|
23
22
|
CodeBlockTab: typeof CodeBlockTab;
|
|
24
23
|
CodeBlockTabs: typeof CodeBlockTabs;
|
|
25
24
|
CodeBlockTabsList: typeof CodeBlockTabsList;
|
|
26
25
|
CodeBlockTabsTrigger: typeof CodeBlockTabsTrigger;
|
|
27
|
-
pre: (props: HTMLAttributes<HTMLPreElement>) =>
|
|
26
|
+
pre: (props: HTMLAttributes<HTMLPreElement>) => React.JSX.Element;
|
|
28
27
|
Card: typeof Card;
|
|
29
28
|
Cards: typeof Cards;
|
|
30
29
|
a: FC<AnchorHTMLAttributes<HTMLAnchorElement>>;
|
|
31
30
|
img: typeof Image;
|
|
32
|
-
h1: (props: HTMLAttributes<HTMLHeadingElement>) =>
|
|
33
|
-
h2: (props: HTMLAttributes<HTMLHeadingElement>) =>
|
|
34
|
-
h3: (props: HTMLAttributes<HTMLHeadingElement>) =>
|
|
35
|
-
h4: (props: HTMLAttributes<HTMLHeadingElement>) =>
|
|
36
|
-
h5: (props: HTMLAttributes<HTMLHeadingElement>) =>
|
|
37
|
-
h6: (props: HTMLAttributes<HTMLHeadingElement>) =>
|
|
31
|
+
h1: (props: HTMLAttributes<HTMLHeadingElement>) => React.JSX.Element;
|
|
32
|
+
h2: (props: HTMLAttributes<HTMLHeadingElement>) => React.JSX.Element;
|
|
33
|
+
h3: (props: HTMLAttributes<HTMLHeadingElement>) => React.JSX.Element;
|
|
34
|
+
h4: (props: HTMLAttributes<HTMLHeadingElement>) => React.JSX.Element;
|
|
35
|
+
h5: (props: HTMLAttributes<HTMLHeadingElement>) => React.JSX.Element;
|
|
36
|
+
h6: (props: HTMLAttributes<HTMLHeadingElement>) => React.JSX.Element;
|
|
38
37
|
table: typeof Table;
|
|
39
38
|
Callout: typeof Callout;
|
|
40
39
|
CalloutContainer: typeof CalloutContainer;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
|
|
3
|
-
//#region ../../node_modules/.pnpm/react-medium-image-zoom@5.4.
|
|
3
|
+
//#region ../../node_modules/.pnpm/react-medium-image-zoom@5.4.6_react-dom@19.2.7_react@19.2.7__react@19.2.7/node_modules/react-medium-image-zoom/dist/controlled.d.ts
|
|
4
4
|
type ModalState = 'LOADED' | 'LOADING' | 'UNLOADED' | 'UNLOADING';
|
|
5
5
|
interface ControlledProps {
|
|
6
6
|
a11yNameButtonUnzoom?: string;
|
|
@@ -6,7 +6,7 @@ import { getStyleGhost } from "./utils/get-style-ghost.js";
|
|
|
6
6
|
import { getStyleModalImg } from "./utils/get-style-modal-img.js";
|
|
7
7
|
import React from "react";
|
|
8
8
|
import ReactDOM from "react-dom";
|
|
9
|
-
//#region ../../node_modules/.pnpm/react-medium-image-zoom@5.4.
|
|
9
|
+
//#region ../../node_modules/.pnpm/react-medium-image-zoom@5.4.6_react-dom@19.2.7_react@19.2.7__react@19.2.7/node_modules/react-medium-image-zoom/dist/controlled.js
|
|
10
10
|
const IMAGE_QUERY = [
|
|
11
11
|
"img",
|
|
12
12
|
"svg",
|
|
@@ -276,7 +276,11 @@ var ControlledBase = class extends React.Component {
|
|
|
276
276
|
bodyStyle.position = prev.position;
|
|
277
277
|
bodyStyle.top = prev.top;
|
|
278
278
|
bodyStyle.overflow = prev.overflow;
|
|
279
|
-
window.scrollTo(
|
|
279
|
+
window.scrollTo({
|
|
280
|
+
left: 0,
|
|
281
|
+
top: this.prevScrollY,
|
|
282
|
+
behavior: "instant"
|
|
283
|
+
});
|
|
280
284
|
this.prevBodyAttrs = defaultBodyAttrs;
|
|
281
285
|
this.prevScrollY = 0;
|
|
282
286
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ControlledProps } from "./controlled.js";
|
|
2
2
|
import React from "react";
|
|
3
3
|
|
|
4
|
-
//#region ../../node_modules/.pnpm/react-medium-image-zoom@5.4.
|
|
4
|
+
//#region ../../node_modules/.pnpm/react-medium-image-zoom@5.4.6_react-dom@19.2.7_react@19.2.7__react@19.2.7/node_modules/react-medium-image-zoom/dist/uncontrolled.d.ts
|
|
5
5
|
type UncontrolledProps = Omit<ControlledProps, 'isZoomed'>;
|
|
6
6
|
//#endregion
|
|
7
7
|
export { UncontrolledProps };
|