@fumadocs/base-ui 16.6.13 → 16.6.15
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/shared.css +11 -0
- package/css/lib/base.css +0 -3
- package/css/preset.css +3 -0
- package/dist/components/image-zoom.js +1 -0
- package/dist/components/tabs.d.ts +3 -3
- package/dist/components/tabs.d.ts.map +1 -1
- package/dist/components/tabs.js +3 -3
- package/dist/components/tabs.js.map +1 -1
- package/dist/components/ui/button.d.ts +1 -1
- package/dist/components/ui/navigation-menu.d.ts +7 -7
- package/dist/components/ui/navigation-menu.d.ts.map +1 -1
- package/dist/components/ui/navigation-menu.js +4 -4
- package/dist/components/ui/navigation-menu.js.map +1 -1
- package/dist/components/ui/popover.d.ts +3 -3
- package/dist/components/ui/popover.d.ts.map +1 -1
- package/dist/components/ui/popover.js +2 -2
- package/dist/components/ui/popover.js.map +1 -1
- package/dist/components/ui/scroll-area.d.ts +4 -4
- package/dist/components/ui/scroll-area.d.ts.map +1 -1
- package/dist/components/ui/scroll-area.js +4 -4
- package/dist/components/ui/scroll-area.js.map +1 -1
- package/dist/i18n.d.ts +8 -4
- package/dist/i18n.d.ts.map +1 -1
- package/dist/i18n.js +12 -9
- package/dist/i18n.js.map +1 -1
- package/dist/layouts/home/client.d.ts +1 -1
- package/dist/layouts/notebook/client.d.ts +1 -1
- package/dist/layouts/notebook/client.d.ts.map +1 -1
- package/dist/layouts/shared/index.d.ts +1 -1
- package/dist/layouts/shared/index.d.ts.map +1 -1
- package/dist/layouts/shared/page-actions.js +2 -2
- package/dist/layouts/shared/page-actions.js.map +1 -1
- package/dist/mdx.d.ts +12 -1
- package/dist/mdx.d.ts.map +1 -1
- package/dist/mdx.js +0 -1
- package/dist/mdx.js.map +1 -1
- package/dist/style.css +15 -15
- package/package.json +10 -9
package/css/generated/shared.css
CHANGED
|
@@ -48,6 +48,7 @@
|
|
|
48
48
|
@source inline("@remarks");
|
|
49
49
|
@source inline("@returns");
|
|
50
50
|
@source inline("@ts-expect-error");
|
|
51
|
+
@source inline("@typescript-eslint/no-namespace");
|
|
51
52
|
@source inline("[&>figure:only-child]:-m-4");
|
|
52
53
|
@source inline("[&>figure:only-child]:border-none");
|
|
53
54
|
@source inline("[&[hidden]:not([hidden='until-found'])]:hidden");
|
|
@@ -253,6 +254,7 @@
|
|
|
253
254
|
@source inline("date");
|
|
254
255
|
@source inline("debounced");
|
|
255
256
|
@source inline("decimal");
|
|
257
|
+
@source inline("declare");
|
|
256
258
|
@source inline("default");
|
|
257
259
|
@source inline("defaultIndex");
|
|
258
260
|
@source inline("defaultItems");
|
|
@@ -390,9 +392,11 @@
|
|
|
390
392
|
@source inline("gap-4");
|
|
391
393
|
@source inline("gap-y-4");
|
|
392
394
|
@source inline("generated");
|
|
395
|
+
@source inline("get");
|
|
393
396
|
@source inline("ghost");
|
|
394
397
|
@source inline("githubUrl");
|
|
395
398
|
@source inline("given");
|
|
399
|
+
@source inline("global");
|
|
396
400
|
@source inline("globalKey");
|
|
397
401
|
@source inline("grid");
|
|
398
402
|
@source inline("grid-cols-2");
|
|
@@ -446,6 +450,7 @@
|
|
|
446
450
|
@source inline("human-readable");
|
|
447
451
|
@source inline("humanizedStars");
|
|
448
452
|
@source inline("i");
|
|
453
|
+
@source inline("i18n");
|
|
449
454
|
@source inline("icon");
|
|
450
455
|
@source inline("icon-sm");
|
|
451
456
|
@source inline("icon-xs");
|
|
@@ -572,6 +577,7 @@
|
|
|
572
577
|
@source inline("md:top-[calc(50%-250px)]");
|
|
573
578
|
@source inline("mdComponents");
|
|
574
579
|
@source inline("mdRenderer");
|
|
580
|
+
@source inline("mdx/types.js");
|
|
575
581
|
@source inline("me-1");
|
|
576
582
|
@source inline("me-2");
|
|
577
583
|
@source inline("me-auto");
|
|
@@ -586,6 +592,7 @@
|
|
|
586
592
|
@source inline("min-w-fit");
|
|
587
593
|
@source inline("min-w-full");
|
|
588
594
|
@source inline("mode");
|
|
595
|
+
@source inline("module");
|
|
589
596
|
@source inline("mounted");
|
|
590
597
|
@source inline("mouse");
|
|
591
598
|
@source inline("ms-2");
|
|
@@ -602,6 +609,7 @@
|
|
|
602
609
|
@source inline("my-6");
|
|
603
610
|
@source inline("my-auto");
|
|
604
611
|
@source inline("name");
|
|
612
|
+
@source inline("namespace");
|
|
605
613
|
@source inline("nav");
|
|
606
614
|
@source inline("navItems");
|
|
607
615
|
@source inline("navbar");
|
|
@@ -742,6 +750,7 @@
|
|
|
742
750
|
@source inline("prose");
|
|
743
751
|
@source inline("prose-no-margin");
|
|
744
752
|
@source inline("provide");
|
|
753
|
+
@source inline("provider");
|
|
745
754
|
@source inline("ps-1");
|
|
746
755
|
@source inline("ps-2");
|
|
747
756
|
@source inline("ps-3");
|
|
@@ -1008,11 +1017,13 @@
|
|
|
1008
1017
|
@source inline("twMerge");
|
|
1009
1018
|
@source inline("type");
|
|
1010
1019
|
@source inline("typeof");
|
|
1020
|
+
@source inline("types");
|
|
1011
1021
|
@source inline("unchanged");
|
|
1012
1022
|
@source inline("undefined");
|
|
1013
1023
|
@source inline("under");
|
|
1014
1024
|
@source inline("underline");
|
|
1015
1025
|
@source inline("underlying");
|
|
1026
|
+
@source inline("understand");
|
|
1016
1027
|
@source inline("unified");
|
|
1017
1028
|
@source inline("unist-util-visit");
|
|
1018
1029
|
@source inline("unknown");
|
package/css/lib/base.css
CHANGED
package/css/preset.css
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Tabs as Tabs$1, TabsContent as TabsContent$1 } from "./ui/tabs.js";
|
|
2
|
-
import * as React from "react";
|
|
2
|
+
import * as React$1 from "react";
|
|
3
3
|
import { ComponentProps, ReactNode } from "react";
|
|
4
4
|
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
5
5
|
import * as _base_ui_react0 from "@base-ui/react";
|
|
@@ -21,8 +21,8 @@ interface TabsProps extends Omit<ComponentProps<typeof Tabs$1>, 'value' | 'onVal
|
|
|
21
21
|
*/
|
|
22
22
|
label?: ReactNode;
|
|
23
23
|
}
|
|
24
|
-
declare const TabsList: React.ForwardRefExoticComponent<Omit<Omit<_base_ui_react0.TabsListProps, "ref"> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
25
|
-
declare const TabsTrigger: React.ForwardRefExoticComponent<Omit<Omit<_base_ui_react0.TabsTabProps, "ref"> & React.RefAttributes<HTMLElement>, "ref"> & React.RefAttributes<HTMLElement>>;
|
|
24
|
+
declare const TabsList: React$1.ForwardRefExoticComponent<Omit<Omit<_base_ui_react0.TabsListProps, "ref"> & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
25
|
+
declare const TabsTrigger: React$1.ForwardRefExoticComponent<Omit<Omit<_base_ui_react0.TabsTabProps, "ref"> & React$1.RefAttributes<HTMLElement>, "ref"> & React$1.RefAttributes<HTMLElement>>;
|
|
26
26
|
declare function Tabs({
|
|
27
27
|
ref,
|
|
28
28
|
className,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tabs.d.ts","names":[],"sources":["../../src/components/tabs.tsx"],"mappings":";;;;;;;UAkBiB,SAAA,SAAkB,IAAA,CACjC,cAAA,QAAsB,MAAA;;;;EAMtB,KAAA;EAPyB;;;;;EAczB,YAAA;EAdqC;;;EAmBrC,KAAA,GAAQ,SAAA;AAAA;AAAA,cAcG,QAAA,EAAQ,
|
|
1
|
+
{"version":3,"file":"tabs.d.ts","names":[],"sources":["../../src/components/tabs.tsx"],"mappings":";;;;;;;UAkBiB,SAAA,SAAkB,IAAA,CACjC,cAAA,QAAsB,MAAA;;;;EAMtB,KAAA;EAPyB;;;;;EAczB,YAAA;EAdqC;;;EAmBrC,KAAA,GAAQ,SAAA;AAAA;AAAA,cAcG,QAAA,EAAQ,OAAA,CAAA,yBAAA,CAAA,IAAA,CAAA,IAAA,CAcnB,eAAA,CAdmB,aAAA,WAAA,OAAA,CAAA,aAAA,CAAA,cAAA,YAAA,OAAA,CAAA,aAAA,CAAA,cAAA;AAAA,cAiBR,WAAA,EAAW,OAAA,CAAA,yBAAA,CAAA,IAAA,CAAA,IAAA,CActB,eAAA,CAdsB,YAAA,WAAA,OAAA,CAAA,aAAA,CAAA,WAAA,YAAA,OAAA,CAAA,aAAA,CAAA,WAAA;AAAA,iBAiBR,IAAA,CAAA;EACd,GAAA;EACA,SAAA;EACA,KAAA;EACA,KAAA;EACA,YAAA;EACA,YAAA;EAAA,GACG;AAAA,GACF,SAAA,GAAS,kBAAA,CAAA,GAAA,CAAA,OAAA;AAAA,UAqCK,QAAA,SAAiB,IAAA,CAAK,cAAA,QAAsB,aAAA;EA7FnD;;;EAiGR,KAAA;AAAA;AAAA,iBAGc,GAAA,CAAA;EAAM,KAAA;EAAA,GAAU;AAAA,GAAS,QAAA,GAAQ,kBAAA,CAAA,GAAA,CAAA,OAAA;AAAA,iBAkBjC,WAAA,CAAA;EACd,KAAA;EACA,SAAA;EAAA,GACG;AAAA,GACF,cAAA,QAAsB,aAAA,IAAqB,kBAAA,CAAA,GAAA,CAAA,OAAA"}
|
package/dist/components/tabs.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn } from "../utils/cn.js";
|
|
3
3
|
import { Tabs as Tabs$1, TabsContent as TabsContent$1, TabsList as TabsList$1, TabsTrigger as TabsTrigger$1 } from "./ui/tabs.js";
|
|
4
|
-
import * as React from "react";
|
|
4
|
+
import * as React$1 from "react";
|
|
5
5
|
import { createContext, useContext, useEffect, useId, useMemo, useState } from "react";
|
|
6
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
7
|
//#region src/components/tabs.tsx
|
|
@@ -11,13 +11,13 @@ function useTabContext() {
|
|
|
11
11
|
if (!ctx) throw new Error("You must wrap your component in <Tabs>");
|
|
12
12
|
return ctx;
|
|
13
13
|
}
|
|
14
|
-
const TabsList = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(TabsList$1, {
|
|
14
|
+
const TabsList = React$1.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(TabsList$1, {
|
|
15
15
|
ref,
|
|
16
16
|
...props,
|
|
17
17
|
className: (s) => cn("flex gap-3.5 text-fd-secondary-foreground overflow-x-auto px-4 not-prose", typeof className === "function" ? className(s) : className)
|
|
18
18
|
}));
|
|
19
19
|
TabsList.displayName = "TabsList";
|
|
20
|
-
const TabsTrigger = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(TabsTrigger$1, {
|
|
20
|
+
const TabsTrigger = React$1.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(TabsTrigger$1, {
|
|
21
21
|
ref,
|
|
22
22
|
...props,
|
|
23
23
|
className: (s) => cn("inline-flex items-center gap-2 whitespace-nowrap text-fd-muted-foreground border-b border-transparent py-2 text-sm font-medium transition-colors [&_svg]:size-4 hover:text-fd-accent-foreground disabled:pointer-events-none disabled:opacity-50 data-[active]:border-fd-primary data-[active]:text-fd-primary", typeof className === "function" ? className(s) : className)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tabs.js","names":["Unstyled.TabsList","Unstyled.TabsTrigger","Unstyled.Tabs","Unstyled.TabsContent"],"sources":["../../src/components/tabs.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport {\n type ComponentProps,\n createContext,\n type ReactNode,\n useContext,\n useEffect,\n useId,\n useMemo,\n useState,\n} from 'react';\nimport { cn } from '@/utils/cn';\nimport * as Unstyled from './ui/tabs';\n\ntype CollectionKey = string | symbol;\n\nexport interface TabsProps extends Omit<\n ComponentProps<typeof Unstyled.Tabs>,\n 'value' | 'onValueChange'\n> {\n /**\n * Use simple mode instead of advanced usage as documented in https://radix-ui.com/primitives/docs/components/tabs.\n */\n items?: string[];\n\n /**\n * Shortcut for `defaultValue` when `items` is provided.\n *\n * @defaultValue 0\n */\n defaultIndex?: number;\n\n /**\n * Additional label in tabs list when `items` is provided.\n */\n label?: ReactNode;\n}\n\nconst TabsContext = createContext<{\n items?: string[];\n collection: CollectionKey[];\n} | null>(null);\n\nfunction useTabContext() {\n const ctx = useContext(TabsContext);\n if (!ctx) throw new Error('You must wrap your component in <Tabs>');\n return ctx;\n}\n\nexport const TabsList = React.forwardRef<\n React.ComponentRef<typeof Unstyled.TabsList>,\n React.ComponentPropsWithoutRef<typeof Unstyled.TabsList>\n>(({ className, ...props }, ref) => (\n <Unstyled.TabsList\n ref={ref}\n {...props}\n className={(s) =>\n cn(\n 'flex gap-3.5 text-fd-secondary-foreground overflow-x-auto px-4 not-prose',\n typeof className === 'function' ? className(s) : className,\n )\n }\n />\n));\nTabsList.displayName = 'TabsList';\n\nexport const TabsTrigger = React.forwardRef<\n React.ComponentRef<typeof Unstyled.TabsTrigger>,\n React.ComponentPropsWithoutRef<typeof Unstyled.TabsTrigger>\n>(({ className, ...props }, ref) => (\n <Unstyled.TabsTrigger\n ref={ref}\n {...props}\n className={(s) =>\n cn(\n 'inline-flex items-center gap-2 whitespace-nowrap text-fd-muted-foreground border-b border-transparent py-2 text-sm font-medium transition-colors [&_svg]:size-4 hover:text-fd-accent-foreground disabled:pointer-events-none disabled:opacity-50 data-[active]:border-fd-primary data-[active]:text-fd-primary',\n typeof className === 'function' ? className(s) : className,\n )\n }\n />\n));\nTabsTrigger.displayName = 'TabsTrigger';\n\nexport function Tabs({\n ref,\n className,\n items,\n label,\n defaultIndex = 0,\n defaultValue = items ? escapeValue(items[defaultIndex]) : undefined,\n ...props\n}: TabsProps) {\n const [value, setValue] = useState(defaultValue);\n const collection = useMemo<CollectionKey[]>(() => [], []);\n\n return (\n <Unstyled.Tabs\n ref={ref}\n className={(s) =>\n cn(\n 'flex flex-col overflow-hidden rounded-xl border bg-fd-secondary my-4',\n typeof className === 'function' ? className(s) : className,\n )\n }\n value={value}\n onValueChange={(v: string) => {\n if (items && !items.some((item) => escapeValue(item) === v)) return;\n setValue(v);\n }}\n {...props}\n >\n {items && (\n <TabsList>\n {label && <span className=\"text-sm font-medium my-auto me-auto\">{label}</span>}\n {items.map((item) => (\n <TabsTrigger key={item} value={escapeValue(item)}>\n {item}\n </TabsTrigger>\n ))}\n </TabsList>\n )}\n <TabsContext.Provider value={useMemo(() => ({ items, collection }), [collection, items])}>\n {props.children}\n </TabsContext.Provider>\n </Unstyled.Tabs>\n );\n}\n\nexport interface TabProps extends Omit<ComponentProps<typeof Unstyled.TabsContent>, 'value'> {\n /**\n * Value of tab, detect from index if unspecified.\n */\n value?: string;\n}\n\nexport function Tab({ value, ...props }: TabProps) {\n const { items } = useTabContext();\n const resolved =\n value ??\n // eslint-disable-next-line react-hooks/rules-of-hooks -- `value` is not supposed to change\n items?.at(useCollectionIndex());\n if (!resolved)\n throw new Error(\n 'Failed to resolve tab `value`, please pass a `value` prop to the Tab component.',\n );\n\n return (\n <TabsContent value={escapeValue(resolved)} {...props}>\n {props.children}\n </TabsContent>\n );\n}\n\nexport function TabsContent({\n value,\n className,\n ...props\n}: ComponentProps<typeof Unstyled.TabsContent>) {\n return (\n <Unstyled.TabsContent\n value={value}\n keepMounted\n className={(s) =>\n cn(\n 'p-4 text-[0.9375rem] bg-fd-background rounded-xl outline-none prose-no-margin data-[inactive]:hidden [&>figure:only-child]:-m-4 [&>figure:only-child]:border-none',\n typeof className === 'function' ? className(s) : className,\n )\n }\n {...props}\n >\n {props.children}\n </Unstyled.TabsContent>\n );\n}\n\n/**\n * Inspired by Headless UI.\n *\n * Return the index of children, this is made possible by registering the order of render from children using React context.\n * This is supposed by work with pre-rendering & pure client-side rendering.\n */\nfunction useCollectionIndex() {\n const key = useId();\n const { collection } = useTabContext();\n\n useEffect(() => {\n return () => {\n const idx = collection.indexOf(key);\n if (idx !== -1) collection.splice(idx, 1);\n };\n }, [key, collection]);\n\n if (!collection.includes(key)) collection.push(key);\n return collection.indexOf(key);\n}\n\n/**\n * only escape whitespaces in values in simple mode\n */\nfunction escapeValue(v: string): string {\n return v.toLowerCase().replace(/\\s/, '-');\n}\n"],"mappings":";;;;;;;AAwCA,MAAM,cAAc,cAGV,KAAK;AAEf,SAAS,gBAAgB;CACvB,MAAM,MAAM,WAAW,YAAY;AACnC,KAAI,CAAC,IAAK,OAAM,IAAI,MAAM,yCAAyC;AACnE,QAAO;;AAGT,MAAa,
|
|
1
|
+
{"version":3,"file":"tabs.js","names":["React","Unstyled.TabsList","Unstyled.TabsTrigger","Unstyled.Tabs","Unstyled.TabsContent"],"sources":["../../src/components/tabs.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport {\n type ComponentProps,\n createContext,\n type ReactNode,\n useContext,\n useEffect,\n useId,\n useMemo,\n useState,\n} from 'react';\nimport { cn } from '@/utils/cn';\nimport * as Unstyled from './ui/tabs';\n\ntype CollectionKey = string | symbol;\n\nexport interface TabsProps extends Omit<\n ComponentProps<typeof Unstyled.Tabs>,\n 'value' | 'onValueChange'\n> {\n /**\n * Use simple mode instead of advanced usage as documented in https://radix-ui.com/primitives/docs/components/tabs.\n */\n items?: string[];\n\n /**\n * Shortcut for `defaultValue` when `items` is provided.\n *\n * @defaultValue 0\n */\n defaultIndex?: number;\n\n /**\n * Additional label in tabs list when `items` is provided.\n */\n label?: ReactNode;\n}\n\nconst TabsContext = createContext<{\n items?: string[];\n collection: CollectionKey[];\n} | null>(null);\n\nfunction useTabContext() {\n const ctx = useContext(TabsContext);\n if (!ctx) throw new Error('You must wrap your component in <Tabs>');\n return ctx;\n}\n\nexport const TabsList = React.forwardRef<\n React.ComponentRef<typeof Unstyled.TabsList>,\n React.ComponentPropsWithoutRef<typeof Unstyled.TabsList>\n>(({ className, ...props }, ref) => (\n <Unstyled.TabsList\n ref={ref}\n {...props}\n className={(s) =>\n cn(\n 'flex gap-3.5 text-fd-secondary-foreground overflow-x-auto px-4 not-prose',\n typeof className === 'function' ? className(s) : className,\n )\n }\n />\n));\nTabsList.displayName = 'TabsList';\n\nexport const TabsTrigger = React.forwardRef<\n React.ComponentRef<typeof Unstyled.TabsTrigger>,\n React.ComponentPropsWithoutRef<typeof Unstyled.TabsTrigger>\n>(({ className, ...props }, ref) => (\n <Unstyled.TabsTrigger\n ref={ref}\n {...props}\n className={(s) =>\n cn(\n 'inline-flex items-center gap-2 whitespace-nowrap text-fd-muted-foreground border-b border-transparent py-2 text-sm font-medium transition-colors [&_svg]:size-4 hover:text-fd-accent-foreground disabled:pointer-events-none disabled:opacity-50 data-[active]:border-fd-primary data-[active]:text-fd-primary',\n typeof className === 'function' ? className(s) : className,\n )\n }\n />\n));\nTabsTrigger.displayName = 'TabsTrigger';\n\nexport function Tabs({\n ref,\n className,\n items,\n label,\n defaultIndex = 0,\n defaultValue = items ? escapeValue(items[defaultIndex]) : undefined,\n ...props\n}: TabsProps) {\n const [value, setValue] = useState(defaultValue);\n const collection = useMemo<CollectionKey[]>(() => [], []);\n\n return (\n <Unstyled.Tabs\n ref={ref}\n className={(s) =>\n cn(\n 'flex flex-col overflow-hidden rounded-xl border bg-fd-secondary my-4',\n typeof className === 'function' ? className(s) : className,\n )\n }\n value={value}\n onValueChange={(v: string) => {\n if (items && !items.some((item) => escapeValue(item) === v)) return;\n setValue(v);\n }}\n {...props}\n >\n {items && (\n <TabsList>\n {label && <span className=\"text-sm font-medium my-auto me-auto\">{label}</span>}\n {items.map((item) => (\n <TabsTrigger key={item} value={escapeValue(item)}>\n {item}\n </TabsTrigger>\n ))}\n </TabsList>\n )}\n <TabsContext.Provider value={useMemo(() => ({ items, collection }), [collection, items])}>\n {props.children}\n </TabsContext.Provider>\n </Unstyled.Tabs>\n );\n}\n\nexport interface TabProps extends Omit<ComponentProps<typeof Unstyled.TabsContent>, 'value'> {\n /**\n * Value of tab, detect from index if unspecified.\n */\n value?: string;\n}\n\nexport function Tab({ value, ...props }: TabProps) {\n const { items } = useTabContext();\n const resolved =\n value ??\n // eslint-disable-next-line react-hooks/rules-of-hooks -- `value` is not supposed to change\n items?.at(useCollectionIndex());\n if (!resolved)\n throw new Error(\n 'Failed to resolve tab `value`, please pass a `value` prop to the Tab component.',\n );\n\n return (\n <TabsContent value={escapeValue(resolved)} {...props}>\n {props.children}\n </TabsContent>\n );\n}\n\nexport function TabsContent({\n value,\n className,\n ...props\n}: ComponentProps<typeof Unstyled.TabsContent>) {\n return (\n <Unstyled.TabsContent\n value={value}\n keepMounted\n className={(s) =>\n cn(\n 'p-4 text-[0.9375rem] bg-fd-background rounded-xl outline-none prose-no-margin data-[inactive]:hidden [&>figure:only-child]:-m-4 [&>figure:only-child]:border-none',\n typeof className === 'function' ? className(s) : className,\n )\n }\n {...props}\n >\n {props.children}\n </Unstyled.TabsContent>\n );\n}\n\n/**\n * Inspired by Headless UI.\n *\n * Return the index of children, this is made possible by registering the order of render from children using React context.\n * This is supposed by work with pre-rendering & pure client-side rendering.\n */\nfunction useCollectionIndex() {\n const key = useId();\n const { collection } = useTabContext();\n\n useEffect(() => {\n return () => {\n const idx = collection.indexOf(key);\n if (idx !== -1) collection.splice(idx, 1);\n };\n }, [key, collection]);\n\n if (!collection.includes(key)) collection.push(key);\n return collection.indexOf(key);\n}\n\n/**\n * only escape whitespaces in values in simple mode\n */\nfunction escapeValue(v: string): string {\n return v.toLowerCase().replace(/\\s/, '-');\n}\n"],"mappings":";;;;;;;AAwCA,MAAM,cAAc,cAGV,KAAK;AAEf,SAAS,gBAAgB;CACvB,MAAM,MAAM,WAAW,YAAY;AACnC,KAAI,CAAC,IAAK,OAAM,IAAI,MAAM,yCAAyC;AACnE,QAAO;;AAGT,MAAa,WAAWA,QAAM,YAG3B,EAAE,WAAW,GAAG,SAAS,QAC1B,oBAACC,YAAD;CACO;CACL,GAAI;CACJ,YAAY,MACV,GACE,4EACA,OAAO,cAAc,aAAa,UAAU,EAAE,GAAG,UAClD;CAEH,CAAA,CACF;AACF,SAAS,cAAc;AAEvB,MAAa,cAAcD,QAAM,YAG9B,EAAE,WAAW,GAAG,SAAS,QAC1B,oBAACE,eAAD;CACO;CACL,GAAI;CACJ,YAAY,MACV,GACE,kTACA,OAAO,cAA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U,EAAE,GAAG,UAClD;EAEH,GAAI;YAEH,MAAM;EACc,CAAA;;;;;;;;AAU3B,SAAS,qBAAqB;CAC5B,MAAM,MAAM,OAAO;CACnB,MAAM,EAAE,eAAe,eAAe;AAEtC,iBAAgB;AACd,eAAa;GACX,MAAM,MAAM,WAAW,QAAQ,IAAI;AACnC,OAAI,QAAQ,GAAI,YAAW,OAAO,KAAK,EAAE;;IAE1C,CAAC,KAAK,WAAW,CAAC;AAErB,KAAI,CAAC,WAAW,SAAS,IAAI,CAAE,YAAW,KAAK,IAAI;AACnD,QAAO,WAAW,QAAQ,IAAI;;;;;AAMhC,SAAS,YAAY,GAAmB;AACtC,QAAO,EAAE,aAAa,CAAC,QAAQ,MAAM,IAAI"}
|
|
@@ -5,7 +5,7 @@ import * as class_variance_authority_types0 from "class-variance-authority/types
|
|
|
5
5
|
declare const buttonVariants: (props?: ({
|
|
6
6
|
variant?: "primary" | "outline" | "ghost" | "secondary" | null | undefined;
|
|
7
7
|
color?: "primary" | "outline" | "ghost" | "secondary" | null | undefined;
|
|
8
|
-
size?: "
|
|
8
|
+
size?: "icon" | "sm" | "icon-sm" | "icon-xs" | null | undefined;
|
|
9
9
|
} & class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
10
10
|
type ButtonProps = VariantProps<typeof buttonVariants>;
|
|
11
11
|
//#endregion
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import * as React from "react";
|
|
1
|
+
import * as React$1 from "react";
|
|
2
2
|
import { NavigationMenu } from "@base-ui/react/navigation-menu";
|
|
3
3
|
import * as _base_ui_react0 from "@base-ui/react";
|
|
4
4
|
|
|
5
5
|
//#region src/components/ui/navigation-menu.d.ts
|
|
6
6
|
type NavigationMenuContentProps = NavigationMenu.Content.Props;
|
|
7
7
|
type NavigationMenuTriggerProps = NavigationMenu.Trigger.Props;
|
|
8
|
-
declare const NavigationMenuRoot: React.ForwardRefExoticComponent<Omit<_base_ui_react0.NavigationMenuRootProps, "ref"> & React.RefAttributes<HTMLElement>>;
|
|
9
|
-
declare const NavigationMenuList: React.ForwardRefExoticComponent<Omit<_base_ui_react0.NavigationMenuListProps, "ref"> & React.RefAttributes<HTMLUListElement>>;
|
|
10
|
-
declare const NavigationMenuItem: React.ForwardRefExoticComponent<Omit<Omit<_base_ui_react0.NavigationMenuItemProps, "ref"> & React.RefAttributes<HTMLLIElement>, "ref"> & React.RefAttributes<HTMLLIElement>>;
|
|
11
|
-
declare const NavigationMenuTrigger: React.ForwardRefExoticComponent<Omit<Omit<_base_ui_react0.NavigationMenuTriggerProps, "ref"> & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
12
|
-
declare const NavigationMenuContent: React.ForwardRefExoticComponent<Omit<Omit<_base_ui_react0.NavigationMenuContentProps, "ref"> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
13
|
-
declare const NavigationMenuLink: React.ForwardRefExoticComponent<Omit<_base_ui_react0.NavigationMenuLinkProps, "ref"> & React.RefAttributes<HTMLAnchorElement>>;
|
|
8
|
+
declare const NavigationMenuRoot: React$1.ForwardRefExoticComponent<Omit<_base_ui_react0.NavigationMenuRootProps, "ref"> & React$1.RefAttributes<HTMLElement>>;
|
|
9
|
+
declare const NavigationMenuList: React$1.ForwardRefExoticComponent<Omit<_base_ui_react0.NavigationMenuListProps, "ref"> & React$1.RefAttributes<HTMLUListElement>>;
|
|
10
|
+
declare const NavigationMenuItem: React$1.ForwardRefExoticComponent<Omit<Omit<_base_ui_react0.NavigationMenuItemProps, "ref"> & React$1.RefAttributes<HTMLLIElement>, "ref"> & React$1.RefAttributes<HTMLLIElement>>;
|
|
11
|
+
declare const NavigationMenuTrigger: React$1.ForwardRefExoticComponent<Omit<Omit<_base_ui_react0.NavigationMenuTriggerProps, "ref"> & React$1.RefAttributes<HTMLButtonElement>, "ref"> & React$1.RefAttributes<HTMLButtonElement>>;
|
|
12
|
+
declare const NavigationMenuContent: React$1.ForwardRefExoticComponent<Omit<Omit<_base_ui_react0.NavigationMenuContentProps, "ref"> & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
13
|
+
declare const NavigationMenuLink: React$1.ForwardRefExoticComponent<Omit<_base_ui_react0.NavigationMenuLinkProps, "ref"> & React$1.RefAttributes<HTMLAnchorElement>>;
|
|
14
14
|
//#endregion
|
|
15
15
|
export { NavigationMenuContent, NavigationMenuContentProps, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuRoot, NavigationMenuTrigger, NavigationMenuTriggerProps };
|
|
16
16
|
//# sourceMappingURL=navigation-menu.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navigation-menu.d.ts","names":[],"sources":["../../../src/components/ui/navigation-menu.tsx"],"mappings":";;;;;KAKY,0BAAA,GAA6B,cAAA,CAAU,OAAA,CAAQ,KAAA;AAAA,KAC/C,0BAAA,GAA6B,cAAA,CAAU,OAAA,CAAQ,KAAA;AAAA,cAErD,kBAAA,EAAkB,
|
|
1
|
+
{"version":3,"file":"navigation-menu.d.ts","names":[],"sources":["../../../src/components/ui/navigation-menu.tsx"],"mappings":";;;;;KAKY,0BAAA,GAA6B,cAAA,CAAU,OAAA,CAAQ,KAAA;AAAA,KAC/C,0BAAA,GAA6B,cAAA,CAAU,OAAA,CAAQ,KAAA;AAAA,cAErD,kBAAA,EAAkB,OAAA,CAAA,yBAAA,CAAA,IAAA,CAAiB,eAAA,CAAjB,uBAAA,WAAA,OAAA,CAAA,aAAA,CAAA,WAAA;AAAA,cAElB,kBAAA,EAAkB,OAAA,CAAA,yBAAA,CAAA,IAAA,CAAiB,eAAA,CAAjB,uBAAA,WAAA,OAAA,CAAA,aAAA,CAAA,gBAAA;AAAA,cAElB,kBAAA,EAAkB,OAAA,CAAA,yBAAA,CAAA,IAAA,CAAA,IAAA,CAWtB,eAAA,CAXsB,uBAAA,WAAA,OAAA,CAAA,aAAA,CAAA,aAAA,YAAA,OAAA,CAAA,aAAA,CAAA,aAAA;AAAA,cAelB,qBAAA,EAAqB,OAAA,CAAA,yBAAA,CAAA,IAAA,CAAA,IAAA,CAOzB,eAAA,CAPyB,0BAAA,WAAA,OAAA,CAAA,aAAA,CAAA,iBAAA,YAAA,OAAA,CAAA,aAAA,CAAA,iBAAA;AAAA,cAUrB,qBAAA,EAAqB,OAAA,CAAA,yBAAA,CAAA,IAAA,CAAA,IAAA,CAoBzB,eAAA,CApByB,0BAAA,WAAA,OAAA,CAAA,aAAA,CAAA,cAAA,YAAA,OAAA,CAAA,aAAA,CAAA,cAAA;AAAA,cAuBrB,kBAAA,EAAkB,OAAA,CAAA,yBAAA,CAAA,IAAA,CAAiB,eAAA,CAAjB,uBAAA,WAAA,OAAA,CAAA,aAAA,CAAA,iBAAA"}
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn } from "../../utils/cn.js";
|
|
3
|
-
import * as React from "react";
|
|
3
|
+
import * as React$1 from "react";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
import { NavigationMenu } from "@base-ui/react/navigation-menu";
|
|
6
6
|
//#region src/components/ui/navigation-menu.tsx
|
|
7
7
|
const NavigationMenuRoot = NavigationMenu.Root;
|
|
8
8
|
const NavigationMenuList = NavigationMenu.List;
|
|
9
|
-
const NavigationMenuItem = React.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx(NavigationMenu.Item, {
|
|
9
|
+
const NavigationMenuItem = React$1.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx(NavigationMenu.Item, {
|
|
10
10
|
ref,
|
|
11
11
|
className: (s) => cn("list-none", typeof className === "function" ? className(s) : className),
|
|
12
12
|
...props,
|
|
13
13
|
children
|
|
14
14
|
}));
|
|
15
15
|
NavigationMenuItem.displayName = NavigationMenu.Item.displayName;
|
|
16
|
-
const NavigationMenuTrigger = React.forwardRef(({ children, ...props }, ref) => /* @__PURE__ */ jsx(NavigationMenu.Trigger, {
|
|
16
|
+
const NavigationMenuTrigger = React$1.forwardRef(({ children, ...props }, ref) => /* @__PURE__ */ jsx(NavigationMenu.Trigger, {
|
|
17
17
|
ref,
|
|
18
18
|
...props,
|
|
19
19
|
children
|
|
20
20
|
}));
|
|
21
21
|
NavigationMenuTrigger.displayName = NavigationMenu.Trigger.displayName;
|
|
22
|
-
const NavigationMenuContent = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(NavigationMenu.Content, {
|
|
22
|
+
const NavigationMenuContent = React$1.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(NavigationMenu.Content, {
|
|
23
23
|
ref,
|
|
24
24
|
className: (s) => cn("size-full p-4", "transition-[opacity,transform,translate] duration-(--duration) ease-(--easing)", "data-starting-style:opacity-0 data-ending-style:opacity-0", "data-starting-style:data-[activation-direction=left]:-translate-x-1/2", "data-starting-style:data-[activation-direction=right]:translate-x-1/2", "data-ending-style:data-[activation-direction=left]:translate-x-1/2", "data-ending-style:data-[activation-direction=right]:-translate-x-1/2", typeof className === "function" ? className(s) : className),
|
|
25
25
|
...props
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"navigation-menu.js","names":["Primitive"],"sources":["../../../src/components/ui/navigation-menu.tsx"],"sourcesContent":["'use client';\nimport * as React from 'react';\nimport { NavigationMenu as Primitive } from '@base-ui/react/navigation-menu';\nimport { cn } from '@/utils/cn';\n\nexport type NavigationMenuContentProps = Primitive.Content.Props;\nexport type NavigationMenuTriggerProps = Primitive.Trigger.Props;\n\nconst NavigationMenuRoot = Primitive.Root;\n\nconst NavigationMenuList = Primitive.List;\n\nconst NavigationMenuItem = React.forwardRef<\n React.ComponentRef<typeof Primitive.Item>,\n React.ComponentPropsWithoutRef<typeof Primitive.Item>\n>(({ className, children, ...props }, ref) => (\n <Primitive.Item\n ref={ref}\n className={(s) => cn('list-none', typeof className === 'function' ? className(s) : className)}\n {...props}\n >\n {children}\n </Primitive.Item>\n));\n\nNavigationMenuItem.displayName = Primitive.Item.displayName;\n\nconst NavigationMenuTrigger = React.forwardRef<\n React.ComponentRef<typeof Primitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof Primitive.Trigger>\n>(({ children, ...props }, ref) => (\n <Primitive.Trigger ref={ref} {...props}>\n {children}\n </Primitive.Trigger>\n));\nNavigationMenuTrigger.displayName = Primitive.Trigger.displayName;\n\nconst NavigationMenuContent = React.forwardRef<\n React.ComponentRef<typeof Primitive.Content>,\n React.ComponentPropsWithoutRef<typeof Primitive.Content>\n>(({ className, ...props }, ref) => (\n <Primitive.Content\n ref={ref}\n className={(s) =>\n cn(\n 'size-full p-4',\n 'transition-[opacity,transform,translate] duration-(--duration) ease-(--easing)',\n 'data-starting-style:opacity-0 data-ending-style:opacity-0',\n 'data-starting-style:data-[activation-direction=left]:-translate-x-1/2',\n 'data-starting-style:data-[activation-direction=right]:translate-x-1/2',\n 'data-ending-style:data-[activation-direction=left]:translate-x-1/2',\n 'data-ending-style:data-[activation-direction=right]:-translate-x-1/2',\n typeof className === 'function' ? className(s) : className,\n )\n }\n {...props}\n />\n));\nNavigationMenuContent.displayName = Primitive.Content.displayName;\n\nconst NavigationMenuLink = Primitive.Link;\n\nexport {\n NavigationMenuRoot,\n NavigationMenuList,\n NavigationMenuItem,\n NavigationMenuContent,\n NavigationMenuTrigger,\n NavigationMenuLink,\n};\n"],"mappings":";;;;;;AAQA,MAAM,qBAAqBA,eAAU;AAErC,MAAM,qBAAqBA,eAAU;AAErC,MAAM,
|
|
1
|
+
{"version":3,"file":"navigation-menu.js","names":["Primitive","React"],"sources":["../../../src/components/ui/navigation-menu.tsx"],"sourcesContent":["'use client';\nimport * as React from 'react';\nimport { NavigationMenu as Primitive } from '@base-ui/react/navigation-menu';\nimport { cn } from '@/utils/cn';\n\nexport type NavigationMenuContentProps = Primitive.Content.Props;\nexport type NavigationMenuTriggerProps = Primitive.Trigger.Props;\n\nconst NavigationMenuRoot = Primitive.Root;\n\nconst NavigationMenuList = Primitive.List;\n\nconst NavigationMenuItem = React.forwardRef<\n React.ComponentRef<typeof Primitive.Item>,\n React.ComponentPropsWithoutRef<typeof Primitive.Item>\n>(({ className, children, ...props }, ref) => (\n <Primitive.Item\n ref={ref}\n className={(s) => cn('list-none', typeof className === 'function' ? className(s) : className)}\n {...props}\n >\n {children}\n </Primitive.Item>\n));\n\nNavigationMenuItem.displayName = Primitive.Item.displayName;\n\nconst NavigationMenuTrigger = React.forwardRef<\n React.ComponentRef<typeof Primitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof Primitive.Trigger>\n>(({ children, ...props }, ref) => (\n <Primitive.Trigger ref={ref} {...props}>\n {children}\n </Primitive.Trigger>\n));\nNavigationMenuTrigger.displayName = Primitive.Trigger.displayName;\n\nconst NavigationMenuContent = React.forwardRef<\n React.ComponentRef<typeof Primitive.Content>,\n React.ComponentPropsWithoutRef<typeof Primitive.Content>\n>(({ className, ...props }, ref) => (\n <Primitive.Content\n ref={ref}\n className={(s) =>\n cn(\n 'size-full p-4',\n 'transition-[opacity,transform,translate] duration-(--duration) ease-(--easing)',\n 'data-starting-style:opacity-0 data-ending-style:opacity-0',\n 'data-starting-style:data-[activation-direction=left]:-translate-x-1/2',\n 'data-starting-style:data-[activation-direction=right]:translate-x-1/2',\n 'data-ending-style:data-[activation-direction=left]:translate-x-1/2',\n 'data-ending-style:data-[activation-direction=right]:-translate-x-1/2',\n typeof className === 'function' ? className(s) : className,\n )\n }\n {...props}\n />\n));\nNavigationMenuContent.displayName = Primitive.Content.displayName;\n\nconst NavigationMenuLink = Primitive.Link;\n\nexport {\n NavigationMenuRoot,\n NavigationMenuList,\n NavigationMenuItem,\n NavigationMenuContent,\n NavigationMenuTrigger,\n NavigationMenuLink,\n};\n"],"mappings":";;;;;;AAQA,MAAM,qBAAqBA,eAAU;AAErC,MAAM,qBAAqBA,eAAU;AAErC,MAAM,qBAAqBC,QAAM,YAG9B,EAAE,WAAW,UAAU,GAAG,SAAS,QACpC,oBAACD,eAAU,MAAX;CACO;CACL,YAAY,MAAM,GAAG,aAAa,OAAO,cAAc,aAAa,UAAU,EAAE,GAAG,UAAU;CAC7F,GAAI;CAEH;CACc,CAAA,CACjB;AAEF,mBAAmB,cAAcA,eAAU,KAAK;AAEhD,MAAM,wBAAwBC,QAAM,YAGjC,EAAE,UAAU,GAAG,SAAS,QACzB,oBAACD,eAAU,SAAX;CAAwB;CAAK,GAAI;CAC9B;CACiB,CAAA,CACpB;AACF,sBAAsB,cAAcA,eAAU,QAAQ;AAEtD,MAAM,wBAAwBC,QAAM,YAGjC,EAAE,WAAW,GAAG,SAAS,QAC1B,oBAACD,eAAU,SAAX;CACO;CACL,YAAY,MACV,GACE,iBACA,kFACA,6DACA,yEACA,yEACA,sEACA,wEACA,OAAO,cAAc,aAAa,UAAU,EAAE,GAAG,UAClD;CAEH,GAAI;CACJ,CAAA,CACF;AACF,sBAAsB,cAAcA,eAAU,QAAQ;AAEtD,MAAM,qBAAqBA,eAAU"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import * as React from "react";
|
|
1
|
+
import * as React$1 from "react";
|
|
2
2
|
import { Popover as Popover$1 } from "@base-ui/react/popover";
|
|
3
3
|
import * as _base_ui_react0 from "@base-ui/react";
|
|
4
4
|
|
|
5
5
|
//#region src/components/ui/popover.d.ts
|
|
6
6
|
declare const Popover: typeof Popover$1.Root;
|
|
7
7
|
declare const PopoverTrigger: Popover$1.Trigger;
|
|
8
|
-
declare const PopoverContent: React.ForwardRefExoticComponent<Omit<Omit<_base_ui_react0.PopoverPopupProps, "ref"> & React.RefAttributes<HTMLDivElement>, "ref"> & Pick<_base_ui_react0.PopoverPositionerProps, "sideOffset" | "align"> & React.RefAttributes<HTMLDivElement>>;
|
|
9
|
-
declare const PopoverClose: React.ForwardRefExoticComponent<Omit<_base_ui_react0.PopoverCloseProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
8
|
+
declare const PopoverContent: React$1.ForwardRefExoticComponent<Omit<Omit<_base_ui_react0.PopoverPopupProps, "ref"> & React$1.RefAttributes<HTMLDivElement>, "ref"> & Pick<_base_ui_react0.PopoverPositionerProps, "sideOffset" | "align"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
9
|
+
declare const PopoverClose: React$1.ForwardRefExoticComponent<Omit<_base_ui_react0.PopoverCloseProps, "ref"> & React$1.RefAttributes<HTMLButtonElement>>;
|
|
10
10
|
//#endregion
|
|
11
11
|
export { Popover, PopoverClose, PopoverContent, PopoverTrigger };
|
|
12
12
|
//# sourceMappingURL=popover.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popover.d.ts","names":[],"sources":["../../../src/components/ui/popover.tsx"],"mappings":";;;;;cAKM,OAAA,SAAO,SAAA,CAAA,IAAA;AAAA,cAEP,cAAA,EAAc,SAAA,CAAA,OAAA;AAAA,cAEd,cAAA,EAAc,
|
|
1
|
+
{"version":3,"file":"popover.d.ts","names":[],"sources":["../../../src/components/ui/popover.tsx"],"mappings":";;;;;cAKM,OAAA,SAAO,SAAA,CAAA,IAAA;AAAA,cAEP,cAAA,EAAc,SAAA,CAAA,OAAA;AAAA,cAEd,cAAA,EAAc,OAAA,CAAA,yBAAA,CAAA,IAAA,CAAA,IAAA,CAmBlB,eAAA,CAnBkB,iBAAA,WAAA,OAAA,CAAA,aAAA,CAAA,cAAA,YAAA,IAAA,CAAA,eAAA,CAAA,sBAAA,4BAAA,OAAA,CAAA,aAAA,CAAA,cAAA;AAAA,cAsBd,YAAA,EAAY,OAAA,CAAA,yBAAA,CAAA,IAAA,CAAkB,eAAA,CAAlB,iBAAA,WAAA,OAAA,CAAA,aAAA,CAAA,iBAAA"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn } from "../../utils/cn.js";
|
|
3
|
-
import * as React from "react";
|
|
3
|
+
import * as React$1 from "react";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
import { Popover as Popover$1 } from "@base-ui/react/popover";
|
|
6
6
|
//#region src/components/ui/popover.tsx
|
|
7
7
|
const Popover = Popover$1.Root;
|
|
8
8
|
const PopoverTrigger = Popover$1.Trigger;
|
|
9
|
-
const PopoverContent = React.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx(Popover$1.Portal, { children: /* @__PURE__ */ jsx(Popover$1.Positioner, {
|
|
9
|
+
const PopoverContent = React$1.forwardRef(({ className, align = "center", sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx(Popover$1.Portal, { children: /* @__PURE__ */ jsx(Popover$1.Positioner, {
|
|
10
10
|
align,
|
|
11
11
|
side: "bottom",
|
|
12
12
|
sideOffset,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popover.js","names":["Primitive"],"sources":["../../../src/components/ui/popover.tsx"],"sourcesContent":["'use client';\nimport { Popover as Primitive } from '@base-ui/react/popover';\nimport * as React from 'react';\nimport { cn } from '@/utils/cn';\n\nconst Popover = Primitive.Root;\n\nconst PopoverTrigger = Primitive.Trigger;\n\nconst PopoverContent = React.forwardRef<\n React.ComponentRef<typeof Primitive.Popup>,\n React.ComponentPropsWithoutRef<typeof Primitive.Popup> &\n Pick<Primitive.Positioner.Props, 'sideOffset' | 'align'>\n>(({ className, align = 'center', sideOffset = 4, ...props }, ref) => (\n <Primitive.Portal>\n <Primitive.Positioner align={align} side=\"bottom\" sideOffset={sideOffset} className=\"z-50\">\n <Primitive.Popup\n ref={ref}\n className={(s) =>\n cn(\n 'z-50 origin-(--transform-origin) overflow-y-auto max-h-(--available-height) min-w-[240px] max-w-[98vw] rounded-xl border bg-fd-popover/60 backdrop-blur-lg p-2 text-sm text-fd-popover-foreground shadow-lg focus-visible:outline-none data-[closed]:animate-fd-popover-out data-[open]:animate-fd-popover-in',\n typeof className === 'function' ? className(s) : className,\n )\n }\n {...props}\n />\n </Primitive.Positioner>\n </Primitive.Portal>\n));\nPopoverContent.displayName = Primitive.Popup.displayName;\n\nconst PopoverClose = Primitive.Close;\n\nexport { Popover, PopoverTrigger, PopoverContent, PopoverClose };\n"],"mappings":";;;;;;AAKA,MAAM,UAAUA,UAAU;AAE1B,MAAM,iBAAiBA,UAAU;AAEjC,MAAM,
|
|
1
|
+
{"version":3,"file":"popover.js","names":["Primitive","React"],"sources":["../../../src/components/ui/popover.tsx"],"sourcesContent":["'use client';\nimport { Popover as Primitive } from '@base-ui/react/popover';\nimport * as React from 'react';\nimport { cn } from '@/utils/cn';\n\nconst Popover = Primitive.Root;\n\nconst PopoverTrigger = Primitive.Trigger;\n\nconst PopoverContent = React.forwardRef<\n React.ComponentRef<typeof Primitive.Popup>,\n React.ComponentPropsWithoutRef<typeof Primitive.Popup> &\n Pick<Primitive.Positioner.Props, 'sideOffset' | 'align'>\n>(({ className, align = 'center', sideOffset = 4, ...props }, ref) => (\n <Primitive.Portal>\n <Primitive.Positioner align={align} side=\"bottom\" sideOffset={sideOffset} className=\"z-50\">\n <Primitive.Popup\n ref={ref}\n className={(s) =>\n cn(\n 'z-50 origin-(--transform-origin) overflow-y-auto max-h-(--available-height) min-w-[240px] max-w-[98vw] rounded-xl border bg-fd-popover/60 backdrop-blur-lg p-2 text-sm text-fd-popover-foreground shadow-lg focus-visible:outline-none data-[closed]:animate-fd-popover-out data-[open]:animate-fd-popover-in',\n typeof className === 'function' ? className(s) : className,\n )\n }\n {...props}\n />\n </Primitive.Positioner>\n </Primitive.Portal>\n));\nPopoverContent.displayName = Primitive.Popup.displayName;\n\nconst PopoverClose = Primitive.Close;\n\nexport { Popover, PopoverTrigger, PopoverContent, PopoverClose };\n"],"mappings":";;;;;;AAKA,MAAM,UAAUA,UAAU;AAE1B,MAAM,iBAAiBA,UAAU;AAEjC,MAAM,iBAAiBC,QAAM,YAI1B,EAAE,WAAW,QAAQ,UAAU,aAAa,GAAG,GAAG,SAAS,QAC5D,oBAACD,UAAU,QAAX,EAAA,UACE,oBAACA,UAAU,YAAX;CAA6B;CAAO,MAAK;CAAqB;CAAY,WAAU;WAClF,oBAACA,UAAU,OAAX;EACO;EACL,YAAY,MACV,GACE,iTACA,OAAO,cAAc,aAAa,UAAU,EAAE,GAAG,UAClD;EAEH,GAAI;EACJ,CAAA;CACmB,CAAA,EACN,CAAA,CACnB;AACF,eAAe,cAAcA,UAAU,MAAM;AAE7C,MAAM,eAAeA,UAAU"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import * as React from "react";
|
|
1
|
+
import * as React$1 from "react";
|
|
2
2
|
import { ScrollArea as ScrollArea$1 } from "@base-ui/react/scroll-area";
|
|
3
3
|
import * as _base_ui_react0 from "@base-ui/react";
|
|
4
4
|
|
|
5
5
|
//#region src/components/ui/scroll-area.d.ts
|
|
6
|
-
declare const ScrollArea: React.ForwardRefExoticComponent<Omit<Omit<_base_ui_react0.ScrollAreaRootProps, "ref"> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
7
|
-
declare const ScrollViewport: React.ForwardRefExoticComponent<Omit<Omit<_base_ui_react0.ScrollAreaViewportProps, "ref"> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
8
|
-
declare const ScrollBar: React.ForwardRefExoticComponent<Omit<Omit<_base_ui_react0.ScrollAreaScrollbarProps, "ref"> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
6
|
+
declare const ScrollArea: React$1.ForwardRefExoticComponent<Omit<Omit<_base_ui_react0.ScrollAreaRootProps, "ref"> & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
7
|
+
declare const ScrollViewport: React$1.ForwardRefExoticComponent<Omit<Omit<_base_ui_react0.ScrollAreaViewportProps, "ref"> & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
8
|
+
declare const ScrollBar: React$1.ForwardRefExoticComponent<Omit<Omit<_base_ui_react0.ScrollAreaScrollbarProps, "ref"> & React$1.RefAttributes<HTMLDivElement>, "ref"> & React$1.RefAttributes<HTMLDivElement>>;
|
|
9
9
|
type ScrollAreaProps = ScrollArea$1.Root.Props;
|
|
10
10
|
//#endregion
|
|
11
11
|
export { ScrollArea, ScrollAreaProps, ScrollBar, ScrollViewport };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scroll-area.d.ts","names":[],"sources":["../../../src/components/ui/scroll-area.tsx"],"mappings":";;;;;cAIM,UAAA,EAAU,
|
|
1
|
+
{"version":3,"file":"scroll-area.d.ts","names":[],"sources":["../../../src/components/ui/scroll-area.tsx"],"mappings":";;;;;cAIM,UAAA,EAAU,OAAA,CAAA,yBAAA,CAAA,IAAA,CAAA,IAAA,CAed,eAAA,CAfc,mBAAA,WAAA,OAAA,CAAA,aAAA,CAAA,cAAA,YAAA,OAAA,CAAA,aAAA,CAAA,cAAA;AAAA,cAmBV,cAAA,EAAc,OAAA,CAAA,yBAAA,CAAA,IAAA,CAAA,IAAA,CAalB,eAAA,CAbkB,uBAAA,WAAA,OAAA,CAAA,aAAA,CAAA,cAAA,YAAA,OAAA,CAAA,aAAA,CAAA,cAAA;AAAA,cAiBd,SAAA,EAAS,OAAA,CAAA,yBAAA,CAAA,IAAA,CAAA,IAAA,CAoBb,eAAA,CApBa,wBAAA,WAAA,OAAA,CAAA,aAAA,CAAA,cAAA,YAAA,OAAA,CAAA,aAAA,CAAA,cAAA;AAAA,KAwBH,eAAA,GAAkB,YAAA,CAAU,IAAA,CAAK,KAAA"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { cn } from "../../utils/cn.js";
|
|
2
|
-
import * as React from "react";
|
|
2
|
+
import * as React$1 from "react";
|
|
3
3
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
4
|
import { ScrollArea as ScrollArea$1 } from "@base-ui/react/scroll-area";
|
|
5
5
|
//#region src/components/ui/scroll-area.tsx
|
|
6
|
-
const ScrollArea = React.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(ScrollArea$1.Root, {
|
|
6
|
+
const ScrollArea = React$1.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(ScrollArea$1.Root, {
|
|
7
7
|
ref,
|
|
8
8
|
className: (s) => cn("overflow-hidden", typeof className === "function" ? className(s) : className),
|
|
9
9
|
...props,
|
|
@@ -14,14 +14,14 @@ const ScrollArea = React.forwardRef(({ className, children, ...props }, ref) =>
|
|
|
14
14
|
]
|
|
15
15
|
}));
|
|
16
16
|
ScrollArea.displayName = ScrollArea$1.Root.displayName;
|
|
17
|
-
const ScrollViewport = React.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx(ScrollArea$1.Viewport, {
|
|
17
|
+
const ScrollViewport = React$1.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx(ScrollArea$1.Viewport, {
|
|
18
18
|
ref,
|
|
19
19
|
className: (s) => cn("size-full rounded-[inherit]", typeof className === "function" ? className(s) : className),
|
|
20
20
|
...props,
|
|
21
21
|
children
|
|
22
22
|
}));
|
|
23
23
|
ScrollViewport.displayName = ScrollArea$1.Viewport.displayName;
|
|
24
|
-
const ScrollBar = React.forwardRef(({ className, orientation = "vertical", ...props }, ref) => /* @__PURE__ */ jsx(ScrollArea$1.Scrollbar, {
|
|
24
|
+
const ScrollBar = React$1.forwardRef(({ className, orientation = "vertical", ...props }, ref) => /* @__PURE__ */ jsx(ScrollArea$1.Scrollbar, {
|
|
25
25
|
ref,
|
|
26
26
|
orientation,
|
|
27
27
|
className: (s) => cn("flex select-none transition-opacity", !s.hovering && "opacity-0", orientation === "vertical" && "h-full w-1.5", orientation === "horizontal" && "h-1.5 flex-col", typeof className === "function" ? className(s) : className),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scroll-area.js","names":["Primitive"],"sources":["../../../src/components/ui/scroll-area.tsx"],"sourcesContent":["import { ScrollArea as Primitive } from '@base-ui/react/scroll-area';\nimport * as React from 'react';\nimport { cn } from '@/utils/cn';\n\nconst ScrollArea = React.forwardRef<\n React.ComponentRef<typeof Primitive.Root>,\n React.ComponentPropsWithoutRef<typeof Primitive.Root>\n>(({ className, children, ...props }, ref) => (\n <Primitive.Root\n ref={ref}\n className={(s) =>\n cn('overflow-hidden', typeof className === 'function' ? className(s) : className)\n }\n {...props}\n >\n {children}\n <Primitive.Corner />\n <ScrollBar orientation=\"vertical\" />\n </Primitive.Root>\n));\n\nScrollArea.displayName = Primitive.Root.displayName;\n\nconst ScrollViewport = React.forwardRef<\n React.ComponentRef<typeof Primitive.Viewport>,\n React.ComponentPropsWithoutRef<typeof Primitive.Viewport>\n>(({ className, children, ...props }, ref) => (\n <Primitive.Viewport\n ref={ref}\n className={(s) =>\n cn('size-full rounded-[inherit]', typeof className === 'function' ? className(s) : className)\n }\n {...props}\n >\n {children}\n </Primitive.Viewport>\n));\n\nScrollViewport.displayName = Primitive.Viewport.displayName;\n\nconst ScrollBar = React.forwardRef<\n React.ComponentRef<typeof Primitive.Scrollbar>,\n React.ComponentPropsWithoutRef<typeof Primitive.Scrollbar>\n>(({ className, orientation = 'vertical', ...props }, ref) => (\n <Primitive.Scrollbar\n ref={ref}\n orientation={orientation}\n className={(s) =>\n cn(\n 'flex select-none transition-opacity',\n !s.hovering && 'opacity-0',\n orientation === 'vertical' && 'h-full w-1.5',\n orientation === 'horizontal' && 'h-1.5 flex-col',\n typeof className === 'function' ? className(s) : className,\n )\n }\n {...props}\n >\n <Primitive.Thumb className=\"relative flex-1 rounded-full bg-fd-border\" />\n </Primitive.Scrollbar>\n));\nScrollBar.displayName = Primitive.Scrollbar.displayName;\n\nexport { ScrollArea, ScrollBar, ScrollViewport };\nexport type ScrollAreaProps = Primitive.Root.Props;\n"],"mappings":";;;;;AAIA,MAAM,
|
|
1
|
+
{"version":3,"file":"scroll-area.js","names":["React","Primitive"],"sources":["../../../src/components/ui/scroll-area.tsx"],"sourcesContent":["import { ScrollArea as Primitive } from '@base-ui/react/scroll-area';\nimport * as React from 'react';\nimport { cn } from '@/utils/cn';\n\nconst ScrollArea = React.forwardRef<\n React.ComponentRef<typeof Primitive.Root>,\n React.ComponentPropsWithoutRef<typeof Primitive.Root>\n>(({ className, children, ...props }, ref) => (\n <Primitive.Root\n ref={ref}\n className={(s) =>\n cn('overflow-hidden', typeof className === 'function' ? className(s) : className)\n }\n {...props}\n >\n {children}\n <Primitive.Corner />\n <ScrollBar orientation=\"vertical\" />\n </Primitive.Root>\n));\n\nScrollArea.displayName = Primitive.Root.displayName;\n\nconst ScrollViewport = React.forwardRef<\n React.ComponentRef<typeof Primitive.Viewport>,\n React.ComponentPropsWithoutRef<typeof Primitive.Viewport>\n>(({ className, children, ...props }, ref) => (\n <Primitive.Viewport\n ref={ref}\n className={(s) =>\n cn('size-full rounded-[inherit]', typeof className === 'function' ? className(s) : className)\n }\n {...props}\n >\n {children}\n </Primitive.Viewport>\n));\n\nScrollViewport.displayName = Primitive.Viewport.displayName;\n\nconst ScrollBar = React.forwardRef<\n React.ComponentRef<typeof Primitive.Scrollbar>,\n React.ComponentPropsWithoutRef<typeof Primitive.Scrollbar>\n>(({ className, orientation = 'vertical', ...props }, ref) => (\n <Primitive.Scrollbar\n ref={ref}\n orientation={orientation}\n className={(s) =>\n cn(\n 'flex select-none transition-opacity',\n !s.hovering && 'opacity-0',\n orientation === 'vertical' && 'h-full w-1.5',\n orientation === 'horizontal' && 'h-1.5 flex-col',\n typeof className === 'function' ? className(s) : className,\n )\n }\n {...props}\n >\n <Primitive.Thumb className=\"relative flex-1 rounded-full bg-fd-border\" />\n </Primitive.Scrollbar>\n));\nScrollBar.displayName = Primitive.Scrollbar.displayName;\n\nexport { ScrollArea, ScrollBar, ScrollViewport };\nexport type ScrollAreaProps = Primitive.Root.Props;\n"],"mappings":";;;;;AAIA,MAAM,aAAaA,QAAM,YAGtB,EAAE,WAAW,UAAU,GAAG,SAAS,QACpC,qBAACC,aAAU,MAAX;CACO;CACL,YAAY,MACV,GAAG,mBAAmB,OAAO,cAAc,aAAa,UAAU,EAAE,GAAG,UAAU;CAEnF,GAAI;WALN;EAOG;EACD,oBAACA,aAAU,QAAX,EAAoB,CAAA;EACpB,oBAAC,WAAD,EAAW,aAAY,YAAa,CAAA;EACrB;GACjB;AAEF,WAAW,cAAcA,aAAU,KAAK;AAExC,MAAM,iBAAiBD,QAAM,YAG1B,EAAE,WAAW,UAAU,GAAG,SAAS,QACpC,oBAACC,aAAU,UAAX;CACO;CACL,YAAY,MACV,GAAG,+BAA+B,OAAO,cAAc,aAAa,UAAU,EAAE,GAAG,UAAU;CAE/F,GAAI;CAEH;CACkB,CAAA,CACrB;AAEF,eAAe,cAAcA,aAAU,SAAS;AAEhD,MAAM,YAAYD,QAAM,YAGrB,EAAE,WAAW,cAAc,YAAY,GAAG,SAAS,QACpD,oBAACC,aAAU,WAAX;CACO;CACQ;CACb,YAAY,MACV,GACE,uCACA,CAAC,EAAE,YAAY,aACf,gBAAgB,cAAc,gBAC9B,gBAAgB,gBAAgB,kBAChC,OAAO,cAAc,aAAa,UAAU,EAAE,GAAG,UAClD;CAEH,GAAI;WAEJ,oBAACA,aAAU,OAAX,EAAiB,WAAU,6CAA8C,CAAA;CACrD,CAAA,CACtB;AACF,UAAU,cAAcA,aAAU,UAAU"}
|
package/dist/i18n.d.ts
CHANGED
|
@@ -2,13 +2,17 @@ import { I18nProviderProps, Translations, defaultTranslations } from "./contexts
|
|
|
2
2
|
import { I18nConfig } from "fumadocs-core/i18n";
|
|
3
3
|
|
|
4
4
|
//#region src/i18n.d.ts
|
|
5
|
+
interface I18nUIConfig<Languages extends string> extends I18nConfig<Languages> {
|
|
6
|
+
/**
|
|
7
|
+
* get i18n config for Fumadocs UI `<RootProvider i18n={config} />`.
|
|
8
|
+
*/
|
|
9
|
+
provider: (locale?: string) => I18nProviderProps;
|
|
10
|
+
}
|
|
5
11
|
declare function defineI18nUI<Languages extends string>(config: I18nConfig<Languages>, options: {
|
|
6
12
|
translations: { [K in Languages]?: Partial<Translations> & {
|
|
7
13
|
displayName?: string;
|
|
8
14
|
} };
|
|
9
|
-
}):
|
|
10
|
-
provider(locale?: string): I18nProviderProps;
|
|
11
|
-
};
|
|
15
|
+
}): I18nUIConfig<Languages>;
|
|
12
16
|
//#endregion
|
|
13
|
-
export { type I18nProviderProps, type Translations, defaultTranslations, defineI18nUI };
|
|
17
|
+
export { type I18nProviderProps, I18nUIConfig, type Translations, defaultTranslations, defineI18nUI };
|
|
14
18
|
//# sourceMappingURL=i18n.d.ts.map
|
package/dist/i18n.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i18n.d.ts","names":[],"sources":["../src/i18n.tsx"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"i18n.d.ts","names":[],"sources":["../src/i18n.tsx"],"mappings":";;;;UAKiB,YAAA,mCAA+C,UAAA,CAAW,SAAA;EAA1D;;;EAIf,QAAA,GAAW,MAAA,cAAoB,iBAAA;AAAA;AAAA,iBAGjB,YAAA,0BAAA,CACd,MAAA,EAAQ,UAAA,CAAW,SAAA,GACnB,OAAA;EACE,YAAA,UACQ,SAAA,IAAa,OAAA,CAAQ,YAAA;IAAkB,WAAA;EAAA;AAAA,IAGhD,YAAA,CAAa,SAAA"}
|
package/dist/i18n.js
CHANGED
|
@@ -2,16 +2,19 @@ import { defaultTranslations } from "./contexts/i18n.js";
|
|
|
2
2
|
//#region src/i18n.tsx
|
|
3
3
|
function defineI18nUI(config, options) {
|
|
4
4
|
const { translations } = options;
|
|
5
|
-
return {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
locales: config.languages.map((locale) => ({
|
|
5
|
+
return {
|
|
6
|
+
...config,
|
|
7
|
+
provider(locale = config.defaultLanguage) {
|
|
8
|
+
return {
|
|
10
9
|
locale,
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
translations: translations[locale],
|
|
11
|
+
locales: config.languages.map((locale) => ({
|
|
12
|
+
locale,
|
|
13
|
+
name: translations[locale]?.displayName ?? locale
|
|
14
|
+
}))
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
};
|
|
15
18
|
}
|
|
16
19
|
//#endregion
|
|
17
20
|
export { defaultTranslations, defineI18nUI };
|
package/dist/i18n.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i18n.js","names":[],"sources":["../src/i18n.tsx"],"sourcesContent":["import type { I18nProviderProps, Translations } from '@/contexts/i18n';\nimport type { I18nConfig } from 'fumadocs-core/i18n';\n\nexport
|
|
1
|
+
{"version":3,"file":"i18n.js","names":[],"sources":["../src/i18n.tsx"],"sourcesContent":["import type { I18nProviderProps, Translations } from '@/contexts/i18n';\nimport type { I18nConfig } from 'fumadocs-core/i18n';\n\nexport { defaultTranslations, type I18nProviderProps, type Translations } from '@/contexts/i18n';\n\nexport interface I18nUIConfig<Languages extends string> extends I18nConfig<Languages> {\n /**\n * get i18n config for Fumadocs UI `<RootProvider i18n={config} />`.\n */\n provider: (locale?: string) => I18nProviderProps;\n}\n\nexport function defineI18nUI<Languages extends string>(\n config: I18nConfig<Languages>,\n options: {\n translations: {\n [K in Languages]?: Partial<Translations> & { displayName?: string };\n };\n },\n): I18nUIConfig<Languages> {\n const { translations } = options;\n\n return {\n ...config,\n provider(locale = config.defaultLanguage) {\n return {\n locale,\n translations: translations[locale as Languages],\n locales: config.languages.map((locale) => ({\n locale,\n name: translations[locale]?.displayName ?? locale,\n })),\n };\n },\n };\n}\n"],"mappings":";;AAYA,SAAgB,aACd,QACA,SAKyB;CACzB,MAAM,EAAE,iBAAiB;AAEzB,QAAO;EACL,GAAG;EACH,SAAS,SAAS,OAAO,iBAAiB;AACxC,UAAO;IACL;IACA,cAAc,aAAa;IAC3B,SAAS,OAAO,UAAU,KAAK,YAAY;KACzC;KACA,MAAM,aAAa,SAAS,eAAe;KAC5C,EAAE;IACJ;;EAEJ"}
|
|
@@ -4,7 +4,7 @@ import * as class_variance_authority_types0 from "class-variance-authority/types
|
|
|
4
4
|
|
|
5
5
|
//#region src/layouts/home/client.d.ts
|
|
6
6
|
declare const navItemVariants: (props?: ({
|
|
7
|
-
variant?: "icon" | "
|
|
7
|
+
variant?: "icon" | "main" | "button" | null | undefined;
|
|
8
8
|
} & class_variance_authority_types0.ClassProp) | undefined) => string;
|
|
9
9
|
declare function Header({
|
|
10
10
|
nav,
|
|
@@ -41,7 +41,7 @@ declare function NavbarLinkItem({
|
|
|
41
41
|
...props
|
|
42
42
|
}: {
|
|
43
43
|
item: LinkItemType;
|
|
44
|
-
} & HTMLAttributes<HTMLElement>): string | number | bigint | boolean |
|
|
44
|
+
} & HTMLAttributes<HTMLElement>): string | number | bigint | boolean | Iterable<ReactNode> | Promise<string | number | bigint | boolean | react.ReactPortal | react.ReactElement<unknown, string | react.JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | react_jsx_runtime0.JSX.Element | null | undefined;
|
|
45
45
|
//#endregion
|
|
46
46
|
export { LayoutBody, LayoutContextProvider, LayoutHeader, LayoutHeaderTabs, LayoutInfo, NavbarLinkItem, useNotebookLayout };
|
|
47
47
|
//# sourceMappingURL=client.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","names":[],"sources":["../../../src/layouts/notebook/client.tsx"],"mappings":";;;;;;;iBA8BgB,iBAAA,CAAA,GAAiB,UAAA;EAAA,gBAAA;AAAA;AAAA,UAShB,UAAA;EACf,OAAA;EACA,OAAA;AAAA;AAAA,iBAGc,qBAAA,CAAA;EACd,kBAAA;EACA,OAAA;EACA,OAAA;EACA;AAAA,GACC,UAAA;EACD,kBAAA;EACA,QAAA,EAAU,SAAA;AAAA,IACX,kBAAA,CAAA,GAAA,CAAA,OAAA;AAAA,iBAoBe,YAAA,CAAa,KAAA,EAAO,cAAA,aAAwB,kBAAA,CAAA,GAAA,CAAA,OAAA;AAAA,i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A,SAAA,IAAA,OAAA,sCAAA,KAAA,CAAA,WAAA,GAAA,KAAA,CAAA,YAAA,mBAAA,KAAA,CAAA,qBAAA,SAAA,QAAA,CAAA,SAAA,wBAAA,kBAAA,CAAA,GAAA,CAAA,OAAA"}
|
|
@@ -62,7 +62,7 @@ declare function resolveLinkItems({
|
|
|
62
62
|
declare function renderTitleNav({
|
|
63
63
|
title,
|
|
64
64
|
url
|
|
65
|
-
}: Partial<NavOptions>, props: ComponentProps<'a'>): string | number | bigint | boolean |
|
|
65
|
+
}: Partial<NavOptions>, props: ComponentProps<'a'>): string | number | bigint | boolean | Iterable<ReactNode> | Promise<string | number | bigint | boolean | react.ReactPortal | react.ReactElement<unknown, string | react.JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | react_jsx_runtime0.JSX.Element | null | undefined;
|
|
66
66
|
declare function useLinkItems({
|
|
67
67
|
githubUrl,
|
|
68
68
|
links
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/layouts/shared/index.tsx"],"mappings":";;;;;;;UAKiB,UAAA;EACf,OAAA;EACA,SAAA,EAAW,SAAA;EAEX,KAAA,GAAQ,SAAA,KAAc,KAAA,EAAO,cAAA,UAAwB,SAAA;EAJtC;;;;EAUf,GAAA;EAN6B;;;;;EAa7B,eAAA;EAEA,QAAA,GAAW,SAAA;AAAA;AAAA,UAGI,eAAA;EACf,WAAA;IACE,OAAA;IACA,SAAA,GAAY,SAAA;IACZ,IAAA;EAAA;EAGF,YAAA,GAAe,OAAA;IACb,OAAA;IACA,UAAA,EAAY,OAAA;MACV,EAAA,EAAI,SAAA;MACJ,EAAA,EAAI,SAAA;IAAA;EAAA;;;;;;EASR,IAAA,aAAiB,UAAA;EAAA;;;EAKjB,SAAA;EAEA,KAAA,GAAQ,YAAA;EAMY;;;EAFpB,GAAA,GAAM,OAAA,CAAQ,UAAA;EAEd,QAAA,GAAW,SAAA;AAAA;;;;iBAMG,gBAAA,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"}
|
|
@@ -34,7 +34,7 @@ function MarkdownCopyButton({ markdownUrl, ...props }) {
|
|
|
34
34
|
size: "sm",
|
|
35
35
|
className: "gap-2 [&_svg]:size-3.5 [&_svg]:text-fd-muted-foreground"
|
|
36
36
|
}), props.className),
|
|
37
|
-
children: [checked ? /* @__PURE__ */ jsx(Check, {}) : /* @__PURE__ */ jsx(Copy, {}), "Copy Markdown"]
|
|
37
|
+
children: [checked ? /* @__PURE__ */ jsx(Check, {}) : /* @__PURE__ */ jsx(Copy, {}), props.children ?? "Copy Markdown"]
|
|
38
38
|
});
|
|
39
39
|
}
|
|
40
40
|
/**
|
|
@@ -164,7 +164,7 @@ function ViewOptionsPopover({ markdownUrl, githubUrl, ...props }) {
|
|
|
164
164
|
color: "secondary",
|
|
165
165
|
size: "sm"
|
|
166
166
|
}), "gap-2", s.open && "bg-fd-accent text-fd-accent-foreground", typeof props.className === "function" ? props.className(s) : props.className),
|
|
167
|
-
children: ["Open", /* @__PURE__ */ jsx(ChevronDown, { className: "size-3.5 text-fd-muted-foreground" })]
|
|
167
|
+
children: [props.children ?? "Open", /* @__PURE__ */ jsx(ChevronDown, { className: "size-3.5 text-fd-muted-foreground" })]
|
|
168
168
|
}), /* @__PURE__ */ jsx(PopoverContent, {
|
|
169
169
|
className: "flex flex-col",
|
|
170
170
|
children: items.map((item) => /* @__PURE__ */ jsxs("a", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page-actions.js","names":[],"sources":["../../../src/layouts/shared/page-actions.tsx"],"sourcesContent":["'use client';\nimport { type ComponentProps, useMemo, useState } from 'react';\nimport { Check, ChevronDown, Copy, ExternalLinkIcon, TextIcon } from 'lucide-react';\nimport { cn } from '@/utils/cn';\nimport { useCopyButton } from '@/utils/use-copy-button';\nimport { Popover, PopoverTrigger, PopoverContent } from '@/components/ui/popover';\nimport { buttonVariants } from '@/components/ui/button';\n\nconst cache = new Map<string, Promise<string>>();\n\n/**\n * see https://fumadocs.dev/docs/integrations/llms#page-actions to customise.\n */\nexport function MarkdownCopyButton({\n markdownUrl,\n ...props\n}: ComponentProps<'button'> & {\n /**\n * A URL to fetch the raw Markdown/MDX content of page\n */\n markdownUrl: string;\n}) {\n const [isLoading, setLoading] = useState(false);\n const [checked, onClick] = useCopyButton(async () => {\n const cached = cache.get(markdownUrl);\n if (cached) return navigator.clipboard.writeText(await cached);\n\n setLoading(true);\n\n try {\n const promise = fetch(markdownUrl).then((res) => res.text());\n cache.set(markdownUrl, promise);\n await navigator.clipboard.write([\n new ClipboardItem({\n 'text/plain': promise,\n }),\n ]);\n } finally {\n setLoading(false);\n }\n });\n\n return (\n <button\n disabled={isLoading}\n onClick={onClick}\n {...props}\n className={cn(\n buttonVariants({\n color: 'secondary',\n size: 'sm',\n className: 'gap-2 [&_svg]:size-3.5 [&_svg]:text-fd-muted-foreground',\n }),\n props.className,\n )}\n >\n {checked ? <Check /> : <Copy />}\n Copy Markdown\n </button>\n );\n}\n\n/**\n * see https://fumadocs.dev/docs/integrations/llms#page-actions to customise.\n */\nexport function ViewOptionsPopover({\n markdownUrl,\n githubUrl,\n ...props\n}: ComponentProps<typeof PopoverTrigger> & {\n /**\n * A URL to the raw Markdown/MDX content of page\n */\n markdownUrl: string;\n\n /**\n * Source file URL on GitHub\n */\n githubUrl: string;\n}) {\n const items = useMemo(() => {\n const pageUrl = typeof window !== 'undefined' ? window.location.href : 'loading';\n const q = `Read ${pageUrl}, I want to ask questions about it.`;\n\n return [\n {\n title: 'Open in GitHub',\n href: githubUrl,\n icon: (\n <svg fill=\"currentColor\" role=\"img\" viewBox=\"0 0 24 24\">\n <title>GitHub</title>\n <path d=\"M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12\" />\n </svg>\n ),\n },\n {\n title: 'View as Markdown',\n href: markdownUrl,\n icon: <TextIcon />,\n },\n {\n title: 'Open in Scira AI',\n href: `https://scira.ai/?${new URLSearchParams({\n q,\n })}`,\n icon: (\n <svg\n width=\"910\"\n height=\"934\"\n viewBox=\"0 0 910 934\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <title>Scira AI</title>\n <path\n d=\"M647.664 197.775C569.13 189.049 525.5 145.419 516.774 66.8849C508.048 145.419 464.418 189.049 385.884 197.775C464.418 206.501 508.048 250.131 516.774 328.665C525.5 250.131 569.13 206.501 647.664 197.775Z\"\n fill=\"currentColor\"\n stroke=\"currentColor\"\n strokeWidth=\"8\"\n strokeLinejoin=\"round\"\n />\n <path\n d=\"M516.774 304.217C510.299 275.491 498.208 252.087 480.335 234.214C462.462 216.341 439.058 204.251 410.333 197.775C439.059 191.3 462.462 179.209 480.335 161.336C498.208 143.463 510.299 120.06 516.774 91.334C523.25 120.059 535.34 143.463 553.213 161.336C571.086 179.209 594.49 191.3 623.216 197.775C594.49 204.251 571.086 216.341 553.213 234.214C535.34 252.087 523.25 275.491 516.774 304.217Z\"\n fill=\"currentColor\"\n stroke=\"currentColor\"\n strokeWidth=\"8\"\n strokeLinejoin=\"round\"\n />\n <path\n d=\"M857.5 508.116C763.259 497.644 710.903 445.288 700.432 351.047C689.961 445.288 637.605 497.644 543.364 508.116C637.605 518.587 689.961 570.943 700.432 665.184C710.903 570.943 763.259 518.587 857.5 508.116Z\"\n stroke=\"currentColor\"\n strokeWidth=\"20\"\n strokeLinejoin=\"round\"\n />\n <path\n d=\"M700.432 615.957C691.848 589.05 678.575 566.357 660.383 548.165C642.191 529.973 619.499 516.7 592.593 508.116C619.499 499.533 642.191 486.258 660.383 468.066C678.575 449.874 691.848 427.181 700.432 400.274C709.015 427.181 722.289 449.874 740.481 468.066C758.673 486.258 781.365 499.533 808.271 508.116C781.365 516.7 758.673 529.973 740.481 548.165C722.289 566.357 709.015 589.05 700.432 615.957Z\"\n stroke=\"currentColor\"\n strokeWidth=\"20\"\n strokeLinejoin=\"round\"\n />\n <path\n d=\"M889.949 121.237C831.049 114.692 798.326 81.9698 791.782 23.0692C785.237 81.9698 752.515 114.692 693.614 121.237C752.515 127.781 785.237 160.504 791.782 219.404C798.326 160.504 831.049 127.781 889.949 121.237Z\"\n fill=\"currentColor\"\n stroke=\"currentColor\"\n strokeWidth=\"8\"\n strokeLinejoin=\"round\"\n />\n <path\n d=\"M791.782 196.795C786.697 176.937 777.869 160.567 765.16 147.858C752.452 135.15 736.082 126.322 716.226 121.237C736.082 116.152 752.452 107.324 765.16 94.6152C777.869 81.9065 786.697 65.5368 791.782 45.6797C796.867 65.5367 805.695 81.9066 818.403 94.6152C831.112 107.324 847.481 116.152 867.338 121.237C847.481 126.322 831.112 135.15 818.403 147.858C805.694 160.567 796.867 176.937 791.782 196.795Z\"\n fill=\"currentColor\"\n stroke=\"currentColor\"\n strokeWidth=\"8\"\n strokeLinejoin=\"round\"\n />\n <path\n d=\"M760.632 764.337C720.719 814.616 669.835 855.1 611.872 882.692C553.91 910.285 490.404 924.255 426.213 923.533C362.022 922.812 298.846 907.419 241.518 878.531C184.19 849.643 134.228 808.026 95.4548 756.863C56.6815 705.7 30.1238 646.346 17.8129 583.343C5.50207 520.339 7.76433 455.354 24.4266 393.359C41.089 331.364 71.7099 274.001 113.947 225.658C156.184 177.315 208.919 139.273 268.117 114.442\"\n stroke=\"currentColor\"\n strokeWidth=\"30\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n ),\n },\n {\n title: 'Open in ChatGPT',\n href: `https://chatgpt.com/?${new URLSearchParams({\n hints: 'search',\n q,\n })}`,\n icon: (\n <svg\n role=\"img\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <title>OpenAI</title>\n <path d=\"M22.2819 9.8211a5.9847 5.9847 0 0 0-.5157-4.9108 6.0462 6.0462 0 0 0-6.5098-2.9A6.0651 6.0651 0 0 0 4.9807 4.1818a5.9847 5.9847 0 0 0-3.9977 2.9 6.0462 6.0462 0 0 0 .7427 7.0966 5.98 5.98 0 0 0 .511 4.9107 6.051 6.051 0 0 0 6.5146 2.9001A5.9847 5.9847 0 0 0 13.2599 24a6.0557 6.0557 0 0 0 5.7718-4.2058 5.9894 5.9894 0 0 0 3.9977-2.9001 6.0557 6.0557 0 0 0-.7475-7.0729zm-9.022 12.6081a4.4755 4.4755 0 0 1-2.8764-1.0408l.1419-.0804 4.7783-2.7582a.7948.7948 0 0 0 .3927-.6813v-6.7369l2.02 1.1686a.071.071 0 0 1 .038.052v5.5826a4.504 4.504 0 0 1-4.4945 4.4944zm-9.6607-4.1254a4.4708 4.4708 0 0 1-.5346-3.0137l.142.0852 4.783 2.7582a.7712.7712 0 0 0 .7806 0l5.8428-3.3685v2.3324a.0804.0804 0 0 1-.0332.0615L9.74 19.9502a4.4992 4.4992 0 0 1-6.1408-1.6464zM2.3408 7.8956a4.485 4.485 0 0 1 2.3655-1.9728V11.6a.7664.7664 0 0 0 .3879.6765l5.8144 3.3543-2.0201 1.1685a.0757.0757 0 0 1-.071 0l-4.8303-2.7865A4.504 4.504 0 0 1 2.3408 7.872zm16.5963 3.8558L13.1038 8.364 15.1192 7.2a.0757.0757 0 0 1 .071 0l4.8303 2.7913a4.4944 4.4944 0 0 1-.6765 8.1042v-5.6772a.79.79 0 0 0-.407-.667zm2.0107-3.0231l-.142-.0852-4.7735-2.7818a.7759.7759 0 0 0-.7854 0L9.409 9.2297V6.8974a.0662.0662 0 0 1 .0284-.0615l4.8303-2.7866a4.4992 4.4992 0 0 1 6.6802 4.66zM8.3065 12.863l-2.02-1.1638a.0804.0804 0 0 1-.038-.0567V6.0742a4.4992 4.4992 0 0 1 7.3757-3.4537l-.142.0805L8.704 5.459a.7948.7948 0 0 0-.3927.6813zm1.0976-2.3654l2.602-1.4998 2.6069 1.4998v2.9994l-2.5974 1.4997-2.6067-1.4997Z\" />\n </svg>\n ),\n },\n {\n title: 'Open in Claude',\n href: `https://claude.ai/new?${new URLSearchParams({\n q,\n })}`,\n icon: (\n <svg\n fill=\"currentColor\"\n role=\"img\"\n viewBox=\"0 0 24 24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <title>Anthropic</title>\n <path d=\"M17.3041 3.541h-3.6718l6.696 16.918H24Zm-10.6082 0L0 20.459h3.7442l1.3693-3.5527h7.0052l1.3693 3.5528h3.7442L10.5363 3.5409Zm-.3712 10.2232 2.2914-5.9456 2.2914 5.9456Z\" />\n </svg>\n ),\n },\n {\n title: 'Open in Cursor',\n icon: (\n <svg\n fill=\"currentColor\"\n role=\"img\"\n viewBox=\"0 0 24 24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <title>Cursor</title>\n <path d=\"M11.503.131 1.891 5.678a.84.84 0 0 0-.42.726v11.188c0 .3.162.575.42.724l9.609 5.55a1 1 0 0 0 .998 0l9.61-5.55a.84.84 0 0 0 .42-.724V6.404a.84.84 0 0 0-.42-.726L12.497.131a1.01 1.01 0 0 0-.996 0M2.657 6.338h18.55c.263 0 .43.287.297.515L12.23 22.918c-.062.107-.229.064-.229-.06V12.335a.59.59 0 0 0-.295-.51l-9.11-5.257c-.109-.063-.064-.23.061-.23\" />\n </svg>\n ),\n href: `https://cursor.com/link/prompt?${new URLSearchParams({\n text: q,\n })}`,\n },\n ];\n }, [githubUrl, markdownUrl]);\n\n return (\n <Popover>\n <PopoverTrigger\n {...props}\n className={(s) =>\n cn(\n buttonVariants({\n color: 'secondary',\n size: 'sm',\n }),\n 'gap-2',\n s.open && 'bg-fd-accent text-fd-accent-foreground',\n typeof props.className === 'function' ? props.className(s) : props.className,\n )\n }\n >\n Open\n <ChevronDown className=\"size-3.5 text-fd-muted-foreground\" />\n </PopoverTrigger>\n <PopoverContent className=\"flex flex-col\">\n {items.map((item) => (\n <a\n key={item.href}\n href={item.href}\n rel=\"noreferrer noopener\"\n target=\"_blank\"\n className=\"text-sm p-2 rounded-lg inline-flex items-center gap-2 hover:text-fd-accent-foreground hover:bg-fd-accent [&_svg]:size-4\"\n >\n {item.icon}\n {item.title}\n <ExternalLinkIcon className=\"text-fd-muted-foreground size-3.5 ms-auto\" />\n </a>\n ))}\n </PopoverContent>\n </Popover>\n );\n}\n"],"mappings":";;;;;;;;;AAQA,MAAM,wBAAQ,IAAI,KAA8B;;;;AAKhD,SAAgB,mBAAmB,EACjC,aACA,GAAG,SAMF;CACD,MAAM,CAAC,WAAW,cAAc,SAAS,MAAM;CAC/C,MAAM,CAAC,SAAS,WAAW,cAAc,YAAY;EACnD,MAAM,SAAS,MAAM,IAAI,YAAY;AACrC,MAAI,OAAQ,QAAO,UAAU,UAAU,UAAU,MAAM,OAAO;AAE9D,aAAW,KAAK;AAEhB,MAAI;GACF,MAAM,UAAU,MAAM,YAAY,CAAC,MAAM,QAAQ,IAAI,MAAM,CAAC;AAC5D,SAAM,IAAI,aAAa,QAAQ;AAC/B,SAAM,UAAU,UAAU,MAAM,CAC9B,IAAI,cAAc,EAChB,cAAc,SACf,CAAC,CACH,CAAC;YACM;AACR,cAAW,MAAM;;GAEnB;AAEF,QACE,qBAAC,UAAD;EACE,UAAU;EACD;EACT,GAAI;EACJ,WAAW,GACT,eAAe;GACb,OAAO;GACP,MAAM;GACN,WAAW;GACZ,CAAC,EACF,MAAM,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,QAAO;GACP,WAAU;aALZ;IAOG,KAAK;IACL,KAAK;IACN,oBAAC,kBAAD,EAAkB,WAAU,6CAA8C,CAAA;IACxE;KATG,KAAK,KASR,CACJ;EACa,CAAA,CACT,EAAA,CAAA"}
|
|
1
|
+
{"version":3,"file":"page-actions.js","names":[],"sources":["../../../src/layouts/shared/page-actions.tsx"],"sourcesContent":["'use client';\nimport { type ComponentProps, useMemo, useState } from 'react';\nimport { Check, ChevronDown, Copy, ExternalLinkIcon, TextIcon } from 'lucide-react';\nimport { cn } from '@/utils/cn';\nimport { useCopyButton } from '@/utils/use-copy-button';\nimport { Popover, PopoverTrigger, PopoverContent } from '@/components/ui/popover';\nimport { buttonVariants } from '@/components/ui/button';\n\nconst cache = new Map<string, Promise<string>>();\n\n/**\n * see https://fumadocs.dev/docs/integrations/llms#page-actions to customise.\n */\nexport function MarkdownCopyButton({\n markdownUrl,\n ...props\n}: ComponentProps<'button'> & {\n /**\n * A URL to fetch the raw Markdown/MDX content of page\n */\n markdownUrl: string;\n}) {\n const [isLoading, setLoading] = useState(false);\n const [checked, onClick] = useCopyButton(async () => {\n const cached = cache.get(markdownUrl);\n if (cached) return navigator.clipboard.writeText(await cached);\n\n setLoading(true);\n\n try {\n const promise = fetch(markdownUrl).then((res) => res.text());\n cache.set(markdownUrl, promise);\n await navigator.clipboard.write([\n new ClipboardItem({\n 'text/plain': promise,\n }),\n ]);\n } finally {\n setLoading(false);\n }\n });\n\n return (\n <button\n disabled={isLoading}\n onClick={onClick}\n {...props}\n className={cn(\n buttonVariants({\n color: 'secondary',\n size: 'sm',\n className: 'gap-2 [&_svg]:size-3.5 [&_svg]:text-fd-muted-foreground',\n }),\n props.className,\n )}\n >\n {checked ? <Check /> : <Copy />}\n {props.children ?? 'Copy Markdown'}\n </button>\n );\n}\n\n/**\n * see https://fumadocs.dev/docs/integrations/llms#page-actions to customise.\n */\nexport function ViewOptionsPopover({\n markdownUrl,\n githubUrl,\n ...props\n}: ComponentProps<typeof PopoverTrigger> & {\n /**\n * A URL to the raw Markdown/MDX content of page\n */\n markdownUrl: string;\n\n /**\n * Source file URL on GitHub\n */\n githubUrl: string;\n}) {\n const items = useMemo(() => {\n const pageUrl = typeof window !== 'undefined' ? window.location.href : 'loading';\n const q = `Read ${pageUrl}, I want to ask questions about it.`;\n\n return [\n {\n title: 'Open in GitHub',\n href: githubUrl,\n icon: (\n <svg fill=\"currentColor\" role=\"img\" viewBox=\"0 0 24 24\">\n <title>GitHub</title>\n <path d=\"M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12\" />\n </svg>\n ),\n },\n {\n title: 'View as Markdown',\n href: markdownUrl,\n icon: <TextIcon />,\n },\n {\n title: 'Open in Scira AI',\n href: `https://scira.ai/?${new URLSearchParams({\n q,\n })}`,\n icon: (\n <svg\n width=\"910\"\n height=\"934\"\n viewBox=\"0 0 910 934\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <title>Scira AI</title>\n <path\n d=\"M647.664 197.775C569.13 189.049 525.5 145.419 516.774 66.8849C508.048 145.419 464.418 189.049 385.884 197.775C464.418 206.501 508.048 250.131 516.774 328.665C525.5 250.131 569.13 206.501 647.664 197.775Z\"\n fill=\"currentColor\"\n stroke=\"currentColor\"\n strokeWidth=\"8\"\n strokeLinejoin=\"round\"\n />\n <path\n d=\"M516.774 304.217C510.299 275.491 498.208 252.087 480.335 234.214C462.462 216.341 439.058 204.251 410.333 197.775C439.059 191.3 462.462 179.209 480.335 161.336C498.208 143.463 510.299 120.06 516.774 91.334C523.25 120.059 535.34 143.463 553.213 161.336C571.086 179.209 594.49 191.3 623.216 197.775C594.49 204.251 571.086 216.341 553.213 234.214C535.34 252.087 523.25 275.491 516.774 304.217Z\"\n fill=\"currentColor\"\n stroke=\"currentColor\"\n strokeWidth=\"8\"\n strokeLinejoin=\"round\"\n />\n <path\n d=\"M857.5 508.116C763.259 497.644 710.903 445.288 700.432 351.047C689.961 445.288 637.605 497.644 543.364 508.116C637.605 518.587 689.961 570.943 700.432 665.184C710.903 570.943 763.259 518.587 857.5 508.116Z\"\n stroke=\"currentColor\"\n strokeWidth=\"20\"\n strokeLinejoin=\"round\"\n />\n <path\n d=\"M700.432 615.957C691.848 589.05 678.575 566.357 660.383 548.165C642.191 529.973 619.499 516.7 592.593 508.116C619.499 499.533 642.191 486.258 660.383 468.066C678.575 449.874 691.848 427.181 700.432 400.274C709.015 427.181 722.289 449.874 740.481 468.066C758.673 486.258 781.365 499.533 808.271 508.116C781.365 516.7 758.673 529.973 740.481 548.165C722.289 566.357 709.015 589.05 700.432 615.957Z\"\n stroke=\"currentColor\"\n strokeWidth=\"20\"\n strokeLinejoin=\"round\"\n />\n <path\n d=\"M889.949 121.237C831.049 114.692 798.326 81.9698 791.782 23.0692C785.237 81.9698 752.515 114.692 693.614 121.237C752.515 127.781 785.237 160.504 791.782 219.404C798.326 160.504 831.049 127.781 889.949 121.237Z\"\n fill=\"currentColor\"\n stroke=\"currentColor\"\n strokeWidth=\"8\"\n strokeLinejoin=\"round\"\n />\n <path\n d=\"M791.782 196.795C786.697 176.937 777.869 160.567 765.16 147.858C752.452 135.15 736.082 126.322 716.226 121.237C736.082 116.152 752.452 107.324 765.16 94.6152C777.869 81.9065 786.697 65.5368 791.782 45.6797C796.867 65.5367 805.695 81.9066 818.403 94.6152C831.112 107.324 847.481 116.152 867.338 121.237C847.481 126.322 831.112 135.15 818.403 147.858C805.694 160.567 796.867 176.937 791.782 196.795Z\"\n fill=\"currentColor\"\n stroke=\"currentColor\"\n strokeWidth=\"8\"\n strokeLinejoin=\"round\"\n />\n <path\n d=\"M760.632 764.337C720.719 814.616 669.835 855.1 611.872 882.692C553.91 910.285 490.404 924.255 426.213 923.533C362.022 922.812 298.846 907.419 241.518 878.531C184.19 849.643 134.228 808.026 95.4548 756.863C56.6815 705.7 30.1238 646.346 17.8129 583.343C5.50207 520.339 7.76433 455.354 24.4266 393.359C41.089 331.364 71.7099 274.001 113.947 225.658C156.184 177.315 208.919 139.273 268.117 114.442\"\n stroke=\"currentColor\"\n strokeWidth=\"30\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n ),\n },\n {\n title: 'Open in ChatGPT',\n href: `https://chatgpt.com/?${new URLSearchParams({\n hints: 'search',\n q,\n })}`,\n icon: (\n <svg\n role=\"img\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <title>OpenAI</title>\n <path d=\"M22.2819 9.8211a5.9847 5.9847 0 0 0-.5157-4.9108 6.0462 6.0462 0 0 0-6.5098-2.9A6.0651 6.0651 0 0 0 4.9807 4.1818a5.9847 5.9847 0 0 0-3.9977 2.9 6.0462 6.0462 0 0 0 .7427 7.0966 5.98 5.98 0 0 0 .511 4.9107 6.051 6.051 0 0 0 6.5146 2.9001A5.9847 5.9847 0 0 0 13.2599 24a6.0557 6.0557 0 0 0 5.7718-4.2058 5.9894 5.9894 0 0 0 3.9977-2.9001 6.0557 6.0557 0 0 0-.7475-7.0729zm-9.022 12.6081a4.4755 4.4755 0 0 1-2.8764-1.0408l.1419-.0804 4.7783-2.7582a.7948.7948 0 0 0 .3927-.6813v-6.7369l2.02 1.1686a.071.071 0 0 1 .038.052v5.5826a4.504 4.504 0 0 1-4.4945 4.4944zm-9.6607-4.1254a4.4708 4.4708 0 0 1-.5346-3.0137l.142.0852 4.783 2.7582a.7712.7712 0 0 0 .7806 0l5.8428-3.3685v2.3324a.0804.0804 0 0 1-.0332.0615L9.74 19.9502a4.4992 4.4992 0 0 1-6.1408-1.6464zM2.3408 7.8956a4.485 4.485 0 0 1 2.3655-1.9728V11.6a.7664.7664 0 0 0 .3879.6765l5.8144 3.3543-2.0201 1.1685a.0757.0757 0 0 1-.071 0l-4.8303-2.7865A4.504 4.504 0 0 1 2.3408 7.872zm16.5963 3.8558L13.1038 8.364 15.1192 7.2a.0757.0757 0 0 1 .071 0l4.8303 2.7913a4.4944 4.4944 0 0 1-.6765 8.1042v-5.6772a.79.79 0 0 0-.407-.667zm2.0107-3.0231l-.142-.0852-4.7735-2.7818a.7759.7759 0 0 0-.7854 0L9.409 9.2297V6.8974a.0662.0662 0 0 1 .0284-.0615l4.8303-2.7866a4.4992 4.4992 0 0 1 6.6802 4.66zM8.3065 12.863l-2.02-1.1638a.0804.0804 0 0 1-.038-.0567V6.0742a4.4992 4.4992 0 0 1 7.3757-3.4537l-.142.0805L8.704 5.459a.7948.7948 0 0 0-.3927.6813zm1.0976-2.3654l2.602-1.4998 2.6069 1.4998v2.9994l-2.5974 1.4997-2.6067-1.4997Z\" />\n </svg>\n ),\n },\n {\n title: 'Open in Claude',\n href: `https://claude.ai/new?${new URLSearchParams({\n q,\n })}`,\n icon: (\n <svg\n fill=\"currentColor\"\n role=\"img\"\n viewBox=\"0 0 24 24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <title>Anthropic</title>\n <path d=\"M17.3041 3.541h-3.6718l6.696 16.918H24Zm-10.6082 0L0 20.459h3.7442l1.3693-3.5527h7.0052l1.3693 3.5528h3.7442L10.5363 3.5409Zm-.3712 10.2232 2.2914-5.9456 2.2914 5.9456Z\" />\n </svg>\n ),\n },\n {\n title: 'Open in Cursor',\n icon: (\n <svg\n fill=\"currentColor\"\n role=\"img\"\n viewBox=\"0 0 24 24\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <title>Cursor</title>\n <path d=\"M11.503.131 1.891 5.678a.84.84 0 0 0-.42.726v11.188c0 .3.162.575.42.724l9.609 5.55a1 1 0 0 0 .998 0l9.61-5.55a.84.84 0 0 0 .42-.724V6.404a.84.84 0 0 0-.42-.726L12.497.131a1.01 1.01 0 0 0-.996 0M2.657 6.338h18.55c.263 0 .43.287.297.515L12.23 22.918c-.062.107-.229.064-.229-.06V12.335a.59.59 0 0 0-.295-.51l-9.11-5.257c-.109-.063-.064-.23.061-.23\" />\n </svg>\n ),\n href: `https://cursor.com/link/prompt?${new URLSearchParams({\n text: q,\n })}`,\n },\n ];\n }, [githubUrl, markdownUrl]);\n\n return (\n <Popover>\n <PopoverTrigger\n {...props}\n className={(s) =>\n cn(\n buttonVariants({\n color: 'secondary',\n size: 'sm',\n }),\n 'gap-2',\n s.open && 'bg-fd-accent text-fd-accent-foreground',\n typeof props.className === 'function' ? props.className(s) : props.className,\n )\n }\n >\n {props.children ?? 'Open'}\n <ChevronDown className=\"size-3.5 text-fd-muted-foreground\" />\n </PopoverTrigger>\n <PopoverContent className=\"flex flex-col\">\n {items.map((item) => (\n <a\n key={item.href}\n href={item.href}\n rel=\"noreferrer noopener\"\n target=\"_blank\"\n className=\"text-sm p-2 rounded-lg inline-flex items-center gap-2 hover:text-fd-accent-foreground hover:bg-fd-accent [&_svg]:size-4\"\n >\n {item.icon}\n {item.title}\n <ExternalLinkIcon className=\"text-fd-muted-foreground size-3.5 ms-auto\" />\n </a>\n ))}\n </PopoverContent>\n </Popover>\n );\n}\n"],"mappings":";;;;;;;;;AAQA,MAAM,wBAAQ,IAAI,KAA8B;;;;AAKhD,SAAgB,mBAAmB,EACjC,aACA,GAAG,SAMF;CACD,MAAM,CAAC,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AAc,CAAA,EACrB,oBAAC,QAAD,EAAM,GAAE,4VAA6V,CAAA,CACjW;;IAER,MAAM,kCAAkC,IAAI,gBAAgB,EAC1D,MAAM,GACP,CAAC;IACH;GACF;IACA,CAAC,WAAW,YAAY,CAAC;AAE5B,QACE,qBAAC,SAAD,EAAA,UAAA,CACE,qBAAC,gBAAD;EACE,GAAI;EACJ,YAAY,MACV,GACE,eAAe;GACb,OAAO;GACP,MAAM;GACP,CAAC,EACF,SACA,EAAE,QAAQ,0CACV,OAAO,MAAM,cAAc,aAAa,MAAM,UAAU,EAAE,GAAG,MAAM,UACpE;YAXL,CAcG,MAAM,YAAY,QACnB,oBAAC,aAAD,EAAa,WAAU,qCAAsC,CAAA,CAC9C;KACjB,oBAAC,gBAAD;EAAgB,WAAU;YACvB,MAAM,KAAK,SACV,qBAAC,KAAD;GAEE,MAAM,KAAK;GACX,KAAI;GACJ,QAAO;GACP,WAAU;aALZ;IAOG,KAAK;IACL,KAAK;IACN,oBAAC,kBAAD,EAAkB,WAAU,6CAA8C,CAAA;IACxE;KATG,KAAK,KASR,CACJ;EACa,CAAA,CACT,EAAA,CAAA"}
|
package/dist/mdx.d.ts
CHANGED
|
@@ -2,10 +2,21 @@ 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 { AnchorHTMLAttributes, FC, HTMLAttributes, ImgHTMLAttributes, TableHTMLAttributes } from "react";
|
|
5
|
+
import React, { AnchorHTMLAttributes, FC, HTMLAttributes, ImgHTMLAttributes, TableHTMLAttributes } from "react";
|
|
6
6
|
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
7
7
|
|
|
8
8
|
//#region src/mdx.d.ts
|
|
9
|
+
/**
|
|
10
|
+
* global types for MDX.js
|
|
11
|
+
*/
|
|
12
|
+
declare module 'mdx/types.js' {
|
|
13
|
+
namespace JSX {
|
|
14
|
+
type Element = React.JSX.Element;
|
|
15
|
+
type ElementClass = React.JSX.ElementClass;
|
|
16
|
+
type ElementType = React.JSX.ElementType;
|
|
17
|
+
type IntrinsicElements = React.JSX.IntrinsicElements;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
9
20
|
declare function Image(props: ImgHTMLAttributes<HTMLImageElement> & {
|
|
10
21
|
sizes?: string;
|
|
11
22
|
}): react_jsx_runtime0.JSX.Element;
|
package/dist/mdx.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mdx.d.ts","names":[],"sources":["../src/mdx.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"mdx.d.ts","names":[],"sources":["../src/mdx.tsx"],"mappings":";;;;;;;;;;;;YA6BY,GAAA;IAAA,KACH,OAAA,GAAU,KAAA,CAAM,GAAA,CAAI,OAAA;IAAA,KACpB,YAAA,GAAe,KAAA,CAAM,GAAA,CAAI,YAAA;IAAA,KACzB,WAAA,GAAc,KAAA,CAAM,GAAA,CAAI,WAAA;IAAA,KACxB,iBAAA,GAAoB,KAAA,CAAM,GAAA,CAAI,iBAAA;EAAA;AAAA;AAAA,iBAI9B,KAAA,CACP,KAAA,EAAO,iBAAA,CAAkB,gBAAA;EACvB,KAAA;AAAA,IACD,kBAAA,CAAA,GAAA,CAAA,OAAA;AAAA,iBAWM,KAAA,CAAM,KAAA,EAAO,mBAAA,CAAoB,gBAAA,IAAiB,kBAAA,CAAA,GAAA,CAAA,OAAA;AAAA,cAQrD,oBAAA;;;;;eAKS,cAAA,CAAe,cAAA,MAAe,kBAAA,CAAA,GAAA,CAAA,OAAA;;;KAOhC,EAAA,CAAG,oBAAA,CAAqB,iBAAA;;cAEvB,cAAA,CAAe,kBAAA,MAAmB,kBAAA,CAAA,GAAA,CAAA,OAAA;cAClC,cAAA,CAAe,kBAAA,MAAmB,kBAAA,CAAA,GAAA,CAAA,OAAA;cAClC,cAAA,CAAe,kBAAA,MAAmB,kBAAA,CAAA,GAAA,CAAA,OAAA;cAClC,cAAA,CAAe,kBAAA,MAAmB,kBAAA,CAAA,GAAA,CAAA,OAAA;cAClC,cAAA,CAAe,kBAAA,MAAmB,kBAAA,CAAA,GAAA,CAAA,OAAA;cAClC,cAAA,CAAe,kBAAA,MAAmB,kBAAA,CAAA,GAAA,CAAA,OAAA;;;;;;;cAQnC,kBAAA,SAEZ,oBAAA"}
|
package/dist/mdx.js
CHANGED
package/dist/mdx.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mdx.js","names":["Image","FrameworkImage"],"sources":["../src/mdx.tsx"],"sourcesContent":["import Link from 'fumadocs-core/link';\nimport type {\n AnchorHTMLAttributes,\n FC,\n HTMLAttributes,\n ImgHTMLAttributes,\n TableHTMLAttributes,\n} from 'react';\nimport { Image as FrameworkImage } from 'fumadocs-core/framework';\nimport { Card, Cards } from '@/components/card';\nimport { Callout, CalloutContainer, CalloutDescription, CalloutTitle } from '@/components/callout';\nimport { Heading } from '@/components/heading';\nimport { cn } from '@/utils/cn';\nimport {\n CodeBlock,\n CodeBlockTab,\n CodeBlockTabs,\n CodeBlockTabsList,\n CodeBlockTabsTrigger,\n Pre,\n} from '@/components/codeblock';\n\nfunction Image(\n props: ImgHTMLAttributes<HTMLImageElement> & {\n sizes?: string;\n },\n) {\n return (\n <FrameworkImage\n sizes=\"(max-width: 768px) 100vw, (max-width: 1200px) 70vw, 900px\"\n {...props}\n
|
|
1
|
+
{"version":3,"file":"mdx.js","names":["Image","FrameworkImage"],"sources":["../src/mdx.tsx"],"sourcesContent":["import Link from 'fumadocs-core/link';\nimport type React from 'react';\nimport type {\n AnchorHTMLAttributes,\n FC,\n HTMLAttributes,\n ImgHTMLAttributes,\n TableHTMLAttributes,\n} from 'react';\nimport { Image as FrameworkImage } from 'fumadocs-core/framework';\nimport { Card, Cards } from '@/components/card';\nimport { Callout, CalloutContainer, CalloutDescription, CalloutTitle } from '@/components/callout';\nimport { Heading } from '@/components/heading';\nimport { cn } from '@/utils/cn';\nimport {\n CodeBlock,\n CodeBlockTab,\n CodeBlockTabs,\n CodeBlockTabsList,\n CodeBlockTabsTrigger,\n Pre,\n} from '@/components/codeblock';\n\n/**\n * global types for MDX.js\n */\ndeclare module 'mdx/types.js' {\n // Augment the MDX types to make it understand React.\n // eslint-disable-next-line @typescript-eslint/no-namespace\n namespace JSX {\n type Element = React.JSX.Element;\n type ElementClass = React.JSX.ElementClass;\n type ElementType = React.JSX.ElementType;\n type IntrinsicElements = React.JSX.IntrinsicElements;\n }\n}\n\nfunction Image(\n props: ImgHTMLAttributes<HTMLImageElement> & {\n sizes?: string;\n },\n) {\n return (\n <FrameworkImage\n sizes=\"(max-width: 768px) 100vw, (max-width: 1200px) 70vw, 900px\"\n {...props}\n className={cn('rounded-lg', props.className)}\n />\n );\n}\n\nfunction Table(props: TableHTMLAttributes<HTMLTableElement>) {\n return (\n <div className=\"relative overflow-auto prose-no-margin my-6\">\n <table {...props} />\n </div>\n );\n}\n\nconst defaultMdxComponents = {\n CodeBlockTab,\n CodeBlockTabs,\n CodeBlockTabsList,\n CodeBlockTabsTrigger,\n pre: (props: HTMLAttributes<HTMLPreElement>) => (\n <CodeBlock {...props}>\n <Pre>{props.children}</Pre>\n </CodeBlock>\n ),\n Card,\n Cards,\n a: Link as FC<AnchorHTMLAttributes<HTMLAnchorElement>>,\n img: Image,\n h1: (props: HTMLAttributes<HTMLHeadingElement>) => <Heading as=\"h1\" {...props} />,\n h2: (props: HTMLAttributes<HTMLHeadingElement>) => <Heading as=\"h2\" {...props} />,\n h3: (props: HTMLAttributes<HTMLHeadingElement>) => <Heading as=\"h3\" {...props} />,\n h4: (props: HTMLAttributes<HTMLHeadingElement>) => <Heading as=\"h4\" {...props} />,\n h5: (props: HTMLAttributes<HTMLHeadingElement>) => <Heading as=\"h5\" {...props} />,\n h6: (props: HTMLAttributes<HTMLHeadingElement>) => <Heading as=\"h6\" {...props} />,\n table: Table,\n Callout,\n CalloutContainer,\n CalloutTitle,\n CalloutDescription,\n};\n\nexport const createRelativeLink: typeof import('./mdx.server').createRelativeLink = () => {\n throw new Error('`createRelativeLink` is only supported in Node.js environment');\n};\n\nexport { defaultMdxComponents as default };\n"],"mappings":";;;;;;;;;AAqCA,SAASA,QACP,OAGA;AACA,QACE,oBAACC,OAAD;EACE,OAAM;EACN,GAAI;EACJ,WAAW,GAAG,cAAc,MAAM,UAAU;EAC5C,CAAA;;AAIN,SAAS,MAAM,OAA8C;AAC3D,QACE,oBAAC,OAAD;EAAK,WAAU;YACb,oBAAC,SAAD,EAAO,GAAI,OAAS,CAAA;EAChB,CAAA;;AAIV,MAAM,uBAAuB;CAC3B;CACA;CACA;CACA;CACA,MAAM,UACJ,oBAAC,WAAD;EAAW,GAAI;YACb,oBAAC,KAAD,EAAA,UAAM,MAAM,UAAe,CAAA;EACjB,CAAA;CAEd;CACA;CACA,GAAG;CACH,KAAKD;CACL,KAAK,UAA8C,oBAAC,SAAD;EAAS,IAAG;EAAK,GAAI;EAAS,CAAA;CACjF,KAAK,UAA8C,oBAAC,SAAD;EAAS,IAAG;EAAK,GAAI;EAAS,CAAA;CACjF,KAAK,UAA8C,oBAAC,SAAD;EAAS,IAAG;EAAK,GAAI;EAAS,CAAA;CACjF,KAAK,UAA8C,oBAAC,SAAD;EAAS,IAAG;EAAK,GAAI;EAAS,CAAA;CACjF,KAAK,UAA8C,oBAAC,SAAD;EAAS,IAAG;EAAK,GAAI;EAAS,CAAA;CACjF,KAAK,UAA8C,oBAAC,SAAD;EAAS,IAAG;EAAK,GAAI;EAAS,CAAA;CACjF,OAAO;CACP;CACA;CACA;CACA;CACD;AAED,MAAa,2BAA6E;AACxF,OAAM,IAAI,MAAM,gEAAgE"}
|
package/dist/style.css
CHANGED
|
@@ -2894,6 +2894,21 @@
|
|
|
2894
2894
|
--color-fd-secondary: hsl(0, 0%, 18%);
|
|
2895
2895
|
--color-fd-muted-foreground: hsl(0, 0%, 72%);
|
|
2896
2896
|
}
|
|
2897
|
+
:root {
|
|
2898
|
+
--fd-sidebar-drawer-offset: 100%;
|
|
2899
|
+
}
|
|
2900
|
+
[dir='rtl'] {
|
|
2901
|
+
--fd-sidebar-drawer-offset: -100%;
|
|
2902
|
+
}
|
|
2903
|
+
@layer base {
|
|
2904
|
+
*, ::after, ::before, ::backdrop, ::file-selector-button {
|
|
2905
|
+
border-color: var(--color-fd-border, currentColor);
|
|
2906
|
+
}
|
|
2907
|
+
body {
|
|
2908
|
+
background-color: var(--color-fd-background);
|
|
2909
|
+
color: var(--color-fd-foreground);
|
|
2910
|
+
}
|
|
2911
|
+
}
|
|
2897
2912
|
.shiki:not(.not-fumadocs-codeblock *) {
|
|
2898
2913
|
--padding-left: calc(var(--spacing) * 4);
|
|
2899
2914
|
--padding-right: calc(var(--spacing) * 4);
|
|
@@ -3000,21 +3015,6 @@
|
|
|
3000
3015
|
font-style: var(--shiki-dark-font-style);
|
|
3001
3016
|
}
|
|
3002
3017
|
}
|
|
3003
|
-
:root {
|
|
3004
|
-
--fd-sidebar-drawer-offset: 100%;
|
|
3005
|
-
}
|
|
3006
|
-
[dir='rtl'] {
|
|
3007
|
-
--fd-sidebar-drawer-offset: -100%;
|
|
3008
|
-
}
|
|
3009
|
-
@layer base {
|
|
3010
|
-
*, ::after, ::before, ::backdrop, ::file-selector-button {
|
|
3011
|
-
border-color: var(--color-fd-border, currentColor);
|
|
3012
|
-
}
|
|
3013
|
-
body {
|
|
3014
|
-
background-color: var(--color-fd-background);
|
|
3015
|
-
color: var(--color-fd-foreground);
|
|
3016
|
-
}
|
|
3017
|
-
}
|
|
3018
3018
|
@layer base {
|
|
3019
3019
|
body {
|
|
3020
3020
|
display: flex;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fumadocs/base-ui",
|
|
3
|
-
"version": "16.6.
|
|
3
|
+
"version": "16.6.15",
|
|
4
4
|
"description": "The Base UI version of Fumadocs UI",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Docs",
|
|
@@ -105,7 +105,7 @@
|
|
|
105
105
|
"@base-ui/react": "^1.2.0",
|
|
106
106
|
"class-variance-authority": "^0.7.1",
|
|
107
107
|
"lucide-react": "^0.577.0",
|
|
108
|
-
"motion": "^12.35.
|
|
108
|
+
"motion": "^12.35.2",
|
|
109
109
|
"next-themes": "^0.4.6",
|
|
110
110
|
"react-medium-image-zoom": "^5.4.1",
|
|
111
111
|
"react-remove-scroll": "^2.7.2",
|
|
@@ -118,25 +118,26 @@
|
|
|
118
118
|
"devDependencies": {
|
|
119
119
|
"@tailwindcss/cli": "^4.2.1",
|
|
120
120
|
"@types/hast": "^3.0.4",
|
|
121
|
-
"@types/
|
|
121
|
+
"@types/mdx": "^2.0.13",
|
|
122
|
+
"@types/node": "^25.4.0",
|
|
122
123
|
"@types/react": "^19.2.14",
|
|
123
124
|
"@types/react-dom": "^19.2.3",
|
|
124
125
|
"tailwindcss": "^4.2.1",
|
|
125
|
-
"tsdown": "0.21.
|
|
126
|
+
"tsdown": "0.21.1",
|
|
126
127
|
"unified": "^11.0.5",
|
|
127
128
|
"@fumadocs/cli": "1.2.5",
|
|
128
129
|
"eslint-config-custom": "0.0.0",
|
|
129
|
-
"fumadocs-core": "16.6.
|
|
130
|
+
"fumadocs-core": "16.6.15",
|
|
130
131
|
"tsconfig": "0.0.0"
|
|
131
132
|
},
|
|
132
133
|
"peerDependencies": {
|
|
133
134
|
"@takumi-rs/image-response": "*",
|
|
135
|
+
"@types/mdx": "*",
|
|
134
136
|
"@types/react": "*",
|
|
135
137
|
"next": "16.x.x",
|
|
136
138
|
"react": "^19.2.0",
|
|
137
139
|
"react-dom": "^19.2.0",
|
|
138
|
-
"
|
|
139
|
-
"fumadocs-core": "16.6.13"
|
|
140
|
+
"fumadocs-core": "16.6.15"
|
|
140
141
|
},
|
|
141
142
|
"peerDependenciesMeta": {
|
|
142
143
|
"next": {
|
|
@@ -145,10 +146,10 @@
|
|
|
145
146
|
"@takumi-rs/image-response": {
|
|
146
147
|
"optional": true
|
|
147
148
|
},
|
|
148
|
-
"@types/
|
|
149
|
+
"@types/mdx": {
|
|
149
150
|
"optional": true
|
|
150
151
|
},
|
|
151
|
-
"
|
|
152
|
+
"@types/react": {
|
|
152
153
|
"optional": true
|
|
153
154
|
}
|
|
154
155
|
},
|