fumadocs-ui 15.0.3 → 15.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. package/dist/components/accordion.js +3 -3
  2. package/dist/components/api.d.ts +3 -3
  3. package/dist/components/api.js +3 -3
  4. package/dist/components/banner.js +2 -2
  5. package/dist/components/callout.js +1 -1
  6. package/dist/components/card.js +1 -1
  7. package/dist/components/codeblock.d.ts.map +1 -1
  8. package/dist/components/codeblock.js +5 -5
  9. package/dist/components/dialog/search-algolia.d.ts +1 -1
  10. package/dist/components/dialog/search-algolia.js +1 -1
  11. package/dist/components/dialog/search-default.d.ts +1 -1
  12. package/dist/components/dialog/search-default.js +2 -2
  13. package/dist/components/dialog/search-orama.d.ts +1 -1
  14. package/dist/components/dialog/search-orama.js +1 -1
  15. package/dist/components/dialog/search.js +4 -4
  16. package/dist/components/dynamic-codeblock.js +2 -2
  17. package/dist/components/files.js +2 -2
  18. package/dist/components/heading.js +1 -1
  19. package/dist/components/inline-toc.d.ts +1 -1
  20. package/dist/components/inline-toc.js +2 -2
  21. package/dist/components/layout/language-toggle.js +4 -4
  22. package/dist/components/layout/nav.js +2 -2
  23. package/dist/components/layout/root-toggle.js +4 -4
  24. package/dist/components/layout/search-toggle.js +4 -4
  25. package/dist/components/layout/theme-toggle.d.ts.map +1 -1
  26. package/dist/components/layout/theme-toggle.js +13 -8
  27. package/dist/components/layout/toc-clerk.js +4 -4
  28. package/dist/components/layout/toc.js +6 -6
  29. package/dist/components/tabs.d.ts +1 -1
  30. package/dist/components/tabs.js +2 -2
  31. package/dist/components/type-table.js +2 -2
  32. package/dist/components/ui/collapsible.js +1 -1
  33. package/dist/components/ui/navigation-menu.js +1 -1
  34. package/dist/components/ui/popover.js +1 -1
  35. package/dist/components/ui/scroll-area.js +1 -1
  36. package/dist/components/ui/tabs.js +1 -1
  37. package/dist/contexts/search.d.ts +1 -1
  38. package/dist/i18n.d.ts +1 -1
  39. package/dist/i18n.js +1 -1
  40. package/dist/layouts/docs/shared.d.ts +3 -3
  41. package/dist/layouts/docs/shared.js +4 -4
  42. package/dist/layouts/docs/sidebar.d.ts +1 -1
  43. package/dist/layouts/docs/sidebar.js +7 -7
  44. package/dist/layouts/docs.client.d.ts +1 -1
  45. package/dist/layouts/docs.client.js +7 -7
  46. package/dist/layouts/docs.d.ts +4 -4
  47. package/dist/layouts/docs.js +16 -16
  48. package/dist/layouts/home/menu.d.ts +2 -2
  49. package/dist/layouts/home/menu.js +4 -4
  50. package/dist/layouts/home/navbar.d.ts +1 -1
  51. package/dist/layouts/home/navbar.d.ts.map +1 -1
  52. package/dist/layouts/home/navbar.js +6 -6
  53. package/dist/layouts/home.d.ts +3 -3
  54. package/dist/layouts/home.d.ts.map +1 -1
  55. package/dist/layouts/home.js +14 -14
  56. package/dist/layouts/links.js +1 -1
  57. package/dist/layouts/notebook.client.js +4 -4
  58. package/dist/layouts/notebook.d.ts +2 -2
  59. package/dist/layouts/notebook.js +15 -15
  60. package/dist/layouts/shared.d.ts +2 -2
  61. package/dist/mdx.client.d.ts +1 -1
  62. package/dist/mdx.client.js +1 -1
  63. package/dist/mdx.d.ts +1 -1
  64. package/dist/mdx.js +5 -5
  65. package/dist/page.client.js +7 -7
  66. package/dist/page.d.ts +3 -3
  67. package/dist/page.d.ts.map +1 -1
  68. package/dist/page.js +17 -14
  69. package/dist/provider.d.ts +7 -7
  70. package/dist/provider.js +8 -8
  71. package/dist/style.css +8 -5
  72. package/dist/theme/typography/index.js +1 -1
  73. package/package.json +12 -12
@@ -3,9 +3,9 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import * as AccordionPrimitive from '@radix-ui/react-accordion';
4
4
  import { Check, ChevronRight, LinkIcon } from 'lucide-react';
5
5
  import { forwardRef, useState, useEffect, } from 'react';
6
- import { cn } from '../utils/cn';
7
- import { useCopyButton } from '../utils/use-copy-button';
8
- import { buttonVariants } from '../components/ui/button';
6
+ import { cn } from '../utils/cn.js';
7
+ import { useCopyButton } from '../utils/use-copy-button.js';
8
+ import { buttonVariants } from '../components/ui/button.js';
9
9
  export const Accordions = forwardRef(({ type = 'single', className, defaultValue, ...props }, ref) => {
10
10
  const [value, setValue] = useState(type === 'single' ? (defaultValue ?? '') : (defaultValue ?? []));
11
11
  useEffect(() => {
@@ -1,4 +1,4 @@
1
- export * from '../utils/cn';
2
- export * from '../components/ui/button';
3
- export { useCopyButton } from '../utils/use-copy-button';
1
+ export * from '../utils/cn.js';
2
+ export * from '../components/ui/button.js';
3
+ export { useCopyButton } from '../utils/use-copy-button.js';
4
4
  //# sourceMappingURL=api.d.ts.map
@@ -1,3 +1,3 @@
1
- export * from '../utils/cn';
2
- export * from '../components/ui/button';
3
- export { useCopyButton } from '../utils/use-copy-button';
1
+ export * from '../utils/cn.js';
2
+ export * from '../components/ui/button.js';
3
+ export { useCopyButton } from '../utils/use-copy-button.js';
@@ -2,8 +2,8 @@
2
2
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
3
  import { useCallback, useEffect, useState } from 'react';
4
4
  import { X } from 'lucide-react';
5
- import { cn } from '../utils/cn';
6
- import { buttonVariants } from '../components/ui/button';
5
+ import { cn } from '../utils/cn.js';
6
+ import { buttonVariants } from '../components/ui/button.js';
7
7
  export function Banner({ id, variant = 'normal', changeLayout = true, height = '3rem', ...props }) {
8
8
  const [open, setOpen] = useState(true);
9
9
  const globalKey = id ? `nd-banner-${id}` : null;
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { AlertTriangle, CircleX, Info } from 'lucide-react';
3
3
  import { forwardRef } from 'react';
4
- import { cn } from '../utils/cn';
4
+ import { cn } from '../utils/cn.js';
5
5
  export const Callout = forwardRef(({ className, children, title, type = 'info', icon, ...props }, ref) => {
6
6
  return (_jsxs("div", { ref: ref, className: cn('my-6 flex flex-row gap-2 rounded-lg border bg-fd-card p-3 text-sm text-fd-card-foreground shadow-md', className), ...props, children: [icon ??
7
7
  {
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import Link from 'fumadocs-core/link';
3
- import { cn } from '../utils/cn';
3
+ import { cn } from '../utils/cn.js';
4
4
  export function Cards(props) {
5
5
  return (_jsx("div", { ...props, className: cn('grid grid-cols-1 gap-4 sm:grid-cols-2', props.className), children: props.children }));
6
6
  }
@@ -1 +1 @@
1
- {"version":3,"file":"codeblock.d.ts","sourceRoot":"","sources":["../../src/components/codeblock.tsx"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,cAAc,EAEnB,KAAK,SAAS,EAIf,MAAM,OAAO,CAAC;AASf,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAE3E,MAAM,MAAM,cAAc,GAAG,cAAc,CAAC,WAAW,CAAC,GAAG;IACzD;;;;OAIG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;IAEjB;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;;;OAIG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IAEzB,aAAa,CAAC,EAAE,uBAAuB,CAAC;CACzC,CAAC;AAEF,eAAO,MAAM,GAAG,2HAYf,CAAC;AAIF,eAAO,MAAM,SAAS;IAxCpB;;;;OAIG;WACI,SAAS;IAEhB;;;;OAIG;gBACS,OAAO;IAEnB;;;;OAIG;qBACc,OAAO;oBAER,uBAAuB;+CAmGxC,CAAC"}
1
+ {"version":3,"file":"codeblock.d.ts","sourceRoot":"","sources":["../../src/components/codeblock.tsx"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,SAAS,EAIf,MAAM,OAAO,CAAC;AASf,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAE3E,MAAM,MAAM,cAAc,GAAG,cAAc,CAAC,WAAW,CAAC,GAAG;IACzD;;;;OAIG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;IAEjB;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;;;OAIG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IAEzB,aAAa,CAAC,EAAE,uBAAuB,CAAC;CACzC,CAAC;AAEF,eAAO,MAAM,GAAG,2HAYf,CAAC;AAIF,eAAO,MAAM,SAAS;IAxCpB;;;;OAIG;WACI,SAAS;IAEhB;;;;OAIG;gBACS,OAAO;IAEnB;;;;OAIG;qBACc,OAAO;oBAER,uBAAuB;+CAmGxC,CAAC"}
@@ -2,10 +2,10 @@
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { Check, Copy } from 'lucide-react';
4
4
  import { forwardRef, useCallback, useRef, } from 'react';
5
- import { cn } from '../utils/cn';
6
- import { ScrollArea, ScrollBar, ScrollViewport, } from '../components/ui/scroll-area';
7
- import { useCopyButton } from '../utils/use-copy-button';
8
- import { buttonVariants } from '../components/ui/button';
5
+ import { cn } from '../utils/cn.js';
6
+ import { ScrollArea, ScrollBar, ScrollViewport, } from '../components/ui/scroll-area.js';
7
+ import { useCopyButton } from '../utils/use-copy-button.js';
8
+ import { buttonVariants } from '../components/ui/button.js';
9
9
  export const Pre = forwardRef(({ className, ...props }, ref) => {
10
10
  return (_jsx("pre", { ref: ref, className: cn('p-4 focus-visible:outline-none', className), ...props, children: props.children }));
11
11
  });
@@ -34,5 +34,5 @@ function CopyButton({ className, onCopy, ...props }) {
34
34
  const [checked, onClick] = useCopyButton(onCopy);
35
35
  return (_jsxs("button", { type: "button", className: cn(buttonVariants({
36
36
  color: 'ghost',
37
- }), 'transition-opacity group-hover:opacity-100', !checked && 'opacity-0', className), "aria-label": "Copy Text", onClick: onClick, ...props, children: [_jsx(Check, { className: cn('size-3.5 transition-transform', !checked && 'scale-0') }), _jsx(Copy, { className: cn('absolute size-3.5 transition-transform', checked && 'scale-0') })] }));
37
+ }), 'transition-opacity group-hover:opacity-100 [&_svg]:size-3.5', !checked && '[@media(hover:hover)]:opacity-0', className), "aria-label": checked ? 'Copied Text' : 'Copy Text', onClick: onClick, ...props, children: [_jsx(Check, { className: cn('transition-transform', !checked && 'scale-0') }), _jsx(Copy, { className: cn('absolute transition-transform', checked && 'scale-0') })] }));
38
38
  }
@@ -1,6 +1,6 @@
1
1
  import { type AlgoliaOptions } from 'fumadocs-core/search/client';
2
2
  import { type ReactNode } from 'react';
3
- import { type SharedProps, type TagItem } from './search';
3
+ import { type SharedProps, type TagItem } from './search.js';
4
4
  export interface AlgoliaSearchDialogProps extends SharedProps {
5
5
  index: AlgoliaOptions['index'];
6
6
  searchOptions?: Omit<AlgoliaOptions, 'index'>;
@@ -3,7 +3,7 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
3
3
  import { useDocsSearch, } from 'fumadocs-core/search/client';
4
4
  import { useState } from 'react';
5
5
  import { useOnChange } from 'fumadocs-core/utils/use-on-change';
6
- import { SearchDialog, TagsList, } from './search';
6
+ import { SearchDialog, TagsList, } from './search.js';
7
7
  export default function AlgoliaSearchDialog({ index, searchOptions, tags, defaultTag, showAlgolia = false, allowClear = false, ...props }) {
8
8
  const [tag, setTag] = useState(defaultTag);
9
9
  const { search, setSearch, query } = useDocsSearch({
@@ -1,5 +1,5 @@
1
1
  import { type ReactNode } from 'react';
2
- import { type SharedProps, type TagItem } from './search';
2
+ import { type SharedProps, type TagItem } from './search.js';
3
3
  export interface DefaultSearchDialogProps extends SharedProps {
4
4
  /**
5
5
  * @defaultValue 'fetch'
@@ -3,8 +3,8 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
3
3
  import { useDocsSearch } from 'fumadocs-core/search/client';
4
4
  import { useState } from 'react';
5
5
  import { useOnChange } from 'fumadocs-core/utils/use-on-change';
6
- import { useI18n } from '../../contexts/i18n';
7
- import { SearchDialog, TagsList, } from './search';
6
+ import { useI18n } from '../../contexts/i18n.js';
7
+ import { SearchDialog, TagsList, } from './search.js';
8
8
  export default function DefaultSearchDialog({ defaultTag, tags, api, delayMs, type = 'fetch', allowClear = false, ...props }) {
9
9
  const { locale } = useI18n();
10
10
  const [tag, setTag] = useState(defaultTag);
@@ -1,6 +1,6 @@
1
1
  import { type OramaCloudOptions } from 'fumadocs-core/search/client';
2
2
  import { type ReactNode } from 'react';
3
- import { type SharedProps, type TagItem } from './search';
3
+ import { type SharedProps, type TagItem } from './search.js';
4
4
  export interface OramaSearchDialogProps extends SharedProps {
5
5
  client: OramaCloudOptions['client'];
6
6
  searchOptions?: OramaCloudOptions['params'];
@@ -3,7 +3,7 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
3
3
  import { useDocsSearch, } from 'fumadocs-core/search/client';
4
4
  import { useState } from 'react';
5
5
  import { useOnChange } from 'fumadocs-core/utils/use-on-change';
6
- import { SearchDialog, TagsList, } from './search';
6
+ import { SearchDialog, TagsList, } from './search.js';
7
7
  /**
8
8
  * Orama Cloud integration
9
9
  */
@@ -3,10 +3,10 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { FileText, Hash, Loader2, SearchIcon, Text } from 'lucide-react';
4
4
  import { useRouter } from 'next/navigation';
5
5
  import { useMemo, useEffect, useState, useRef, useCallback, } from 'react';
6
- import { useI18n } from '../../contexts/i18n';
7
- import { cn } from '../../utils/cn';
8
- import { useSidebar } from '../../contexts/sidebar';
9
- import { buttonVariants } from '../../components/ui/button';
6
+ import { useI18n } from '../../contexts/i18n.js';
7
+ import { cn } from '../../utils/cn.js';
8
+ import { useSidebar } from '../../contexts/sidebar.js';
9
+ import { buttonVariants } from '../../components/ui/button.js';
10
10
  import { Dialog, DialogContent, DialogOverlay, DialogTitle, } from '@radix-ui/react-dialog';
11
11
  import { cva } from 'class-variance-authority';
12
12
  export function SearchDialog({ open, onOpenChange, footer, links = [], search, onSearchChange, isLoading, ...props }) {
@@ -1,9 +1,9 @@
1
1
  'use client';
2
2
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { CodeBlock, Pre } from '../components/codeblock';
3
+ import { CodeBlock, Pre } from '../components/codeblock.js';
4
4
  import { PrerenderScript, useShiki } from 'fumadocs-core/utils/use-shiki';
5
5
  import { useId } from 'react';
6
- import { cn } from '../utils/cn';
6
+ import { cn } from '../utils/cn.js';
7
7
  const components = {
8
8
  pre(props) {
9
9
  return (_jsx(CodeBlock, { ...props, className: cn('my-0', props.className), children: _jsx(Pre, { children: props.children }) }));
@@ -3,8 +3,8 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { cva } from 'class-variance-authority';
4
4
  import { FileIcon, FolderIcon, FolderOpen } from 'lucide-react';
5
5
  import { useState } from 'react';
6
- import { cn } from '../utils/cn';
7
- import { Collapsible, CollapsibleContent, CollapsibleTrigger, } from './ui/collapsible';
6
+ import { cn } from '../utils/cn.js';
7
+ import { Collapsible, CollapsibleContent, CollapsibleTrigger, } from './ui/collapsible.js';
8
8
  const itemVariants = cva('flex flex-row items-center gap-2 rounded-md px-2 py-1.5 text-sm hover:bg-fd-accent hover:text-fd-accent-foreground [&_svg]:size-4');
9
9
  export function Files({ className, ...props }) {
10
10
  return (_jsx("div", { className: cn('not-prose rounded-md border bg-fd-card p-2', className), ...props, children: props.children }));
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Link } from 'lucide-react';
3
- import { cn } from '../utils/cn';
3
+ import { cn } from '../utils/cn.js';
4
4
  export function Heading({ as, className, ...props }) {
5
5
  const As = as ?? 'h1';
6
6
  if (!props.id)
@@ -1,5 +1,5 @@
1
1
  import type { TOCItemType } from 'fumadocs-core/server';
2
- import { Collapsible } from './ui/collapsible';
2
+ import { Collapsible } from './ui/collapsible.js';
3
3
  import { ComponentProps } from 'react';
4
4
  export interface InlineTocProps extends ComponentProps<typeof Collapsible> {
5
5
  items: TOCItemType[];
@@ -1,8 +1,8 @@
1
1
  'use client';
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { ChevronDown } from 'lucide-react';
4
- import { Collapsible, CollapsibleContent, CollapsibleTrigger, } from './ui/collapsible';
5
- import { cn } from '../utils/cn';
4
+ import { Collapsible, CollapsibleContent, CollapsibleTrigger, } from './ui/collapsible.js';
5
+ import { cn } from '../utils/cn.js';
6
6
  export function InlineTOC({ items, ...props }) {
7
7
  return (_jsxs(Collapsible, { ...props, className: cn('not-prose rounded-lg border bg-fd-card text-fd-card-foreground', props.className), children: [_jsxs(CollapsibleTrigger, { className: "group inline-flex w-full items-center justify-between px-4 py-2.5 font-medium", children: [props.children ?? 'Table of Contents', _jsx(ChevronDown, { className: "size-4 transition-transform duration-200 group-data-[state=open]:rotate-180" })] }), _jsx(CollapsibleContent, { children: _jsx("div", { className: "flex flex-col p-4 pt-0 text-sm text-fd-muted-foreground", children: items.map((item) => (_jsx("a", { href: item.url, className: "border-s py-1.5 hover:text-fd-accent-foreground", style: {
8
8
  paddingInlineStart: 12 * Math.max(item.depth - 1, 0),
@@ -1,9 +1,9 @@
1
1
  'use client';
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { useI18n } from '../../contexts/i18n';
4
- import { Popover, PopoverContent, PopoverTrigger, } from '../../components/ui/popover';
5
- import { cn } from '../../utils/cn';
6
- import { buttonVariants } from '../../components/ui/button';
3
+ import { useI18n } from '../../contexts/i18n.js';
4
+ import { Popover, PopoverContent, PopoverTrigger, } from '../../components/ui/popover.js';
5
+ import { cn } from '../../utils/cn.js';
6
+ import { buttonVariants } from '../../components/ui/button.js';
7
7
  export function LanguageToggle(props) {
8
8
  const context = useI18n();
9
9
  if (!context.locales)
@@ -2,8 +2,8 @@
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
3
  import Link from 'fumadocs-core/link';
4
4
  import { createContext, useContext, useEffect, useState, } from 'react';
5
- import { cn } from '../../utils/cn';
6
- import { useI18n } from '../../contexts/i18n';
5
+ import { cn } from '../../utils/cn.js';
6
+ import { useI18n } from '../../contexts/i18n.js';
7
7
  const NavContext = createContext({
8
8
  isTransparent: false,
9
9
  });
@@ -4,10 +4,10 @@ import { ChevronDown } from 'lucide-react';
4
4
  import { useMemo, useState } from 'react';
5
5
  import Link from 'next/link';
6
6
  import { usePathname } from 'next/navigation';
7
- import { cn } from '../../utils/cn';
8
- import { isActive } from '../../utils/is-active';
9
- import { useSidebar } from '../../contexts/sidebar';
10
- import { Popover, PopoverContent, PopoverTrigger } from '../ui/popover';
7
+ import { cn } from '../../utils/cn.js';
8
+ import { isActive } from '../../utils/is-active.js';
9
+ import { useSidebar } from '../../contexts/sidebar.js';
10
+ import { Popover, PopoverContent, PopoverTrigger } from '../ui/popover.js';
11
11
  export function RootToggle({ options, placeholder, ...props }) {
12
12
  const [open, setOpen] = useState(false);
13
13
  const { closeOnRedirect } = useSidebar();
@@ -1,10 +1,10 @@
1
1
  'use client';
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { SearchIcon } from 'lucide-react';
4
- import { useSearchContext } from '../../contexts/search';
5
- import { useI18n } from '../../contexts/i18n';
6
- import { cn } from '../../utils/cn';
7
- import { buttonVariants } from '../../components/ui/button';
4
+ import { useSearchContext } from '../../contexts/search.js';
5
+ import { useI18n } from '../../contexts/i18n.js';
6
+ import { cn } from '../../utils/cn.js';
7
+ import { buttonVariants } from '../../components/ui/button.js';
8
8
  export function SearchToggle({ hideIfDisabled, ...props }) {
9
9
  const { setOpenSearch, enabled } = useSearchContext();
10
10
  if (hideIfDisabled && !enabled)
@@ -1 +1 @@
1
- {"version":3,"file":"theme-toggle.d.ts","sourceRoot":"","sources":["../../../src/components/layout/theme-toggle.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,cAAc,EAA6B,MAAM,OAAO,CAAC;AAYvE,wBAAgB,WAAW,CAAC,EAC1B,SAAS,EACT,IAAmB,EACnB,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,WAAW,CAAC,GAAG;IAC/B,IAAI,CAAC,EAAE,YAAY,GAAG,mBAAmB,CAAC;CAC3C,2CAiDA"}
1
+ {"version":3,"file":"theme-toggle.d.ts","sourceRoot":"","sources":["../../../src/components/layout/theme-toggle.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,cAAc,EAA6B,MAAM,OAAO,CAAC;AAkBvE,wBAAgB,WAAW,CAAC,EAC1B,SAAS,EACT,IAAmB,EACnB,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,WAAW,CAAC,GAAG;IAC/B,IAAI,CAAC,EAAE,YAAY,GAAG,mBAAmB,CAAC;CAC3C,2CAsDA"}
@@ -1,10 +1,10 @@
1
1
  'use client';
2
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
3
  import { cva } from 'class-variance-authority';
4
4
  import { Moon, Sun, Airplay } from 'lucide-react';
5
5
  import { useTheme } from 'next-themes';
6
6
  import { useLayoutEffect, useState } from 'react';
7
- import { cn } from '../../utils/cn';
7
+ import { cn } from '../../utils/cn.js';
8
8
  const itemVariants = cva('size-7 rounded-full p-1.5 text-fd-muted-foreground', {
9
9
  variants: {
10
10
  active: {
@@ -13,6 +13,11 @@ const itemVariants = cva('size-7 rounded-full p-1.5 text-fd-muted-foreground', {
13
13
  },
14
14
  },
15
15
  });
16
+ const full = [
17
+ ['light', Sun],
18
+ ['dark', Moon],
19
+ ['system', Airplay],
20
+ ];
16
21
  export function ThemeToggle({ className, mode = 'light-dark', ...props }) {
17
22
  const { setTheme, theme, resolvedTheme } = useTheme();
18
23
  const [mounted, setMounted] = useState(false);
@@ -22,12 +27,12 @@ export function ThemeToggle({ className, mode = 'light-dark', ...props }) {
22
27
  const container = cn('inline-flex items-center rounded-full border p-[3px]', className);
23
28
  if (mode === 'light-dark') {
24
29
  const value = mounted ? resolvedTheme : null;
25
- return (_jsxs("button", { className: container, onClick: () => setTheme(value === 'light' ? 'dark' : 'light'), "data-theme-toggle": "", ...props, children: [_jsx(Sun, { className: cn(itemVariants({ active: value === 'light' })) }), _jsx(Moon, { className: cn(itemVariants({ active: value === 'dark' })) })] }));
30
+ return (_jsx("button", { className: container, "aria-label": `Toggle Theme`, onClick: () => setTheme(value === 'light' ? 'dark' : 'light'), "data-theme-toggle": "", ...props, children: full.map(([key, Icon]) => {
31
+ if (key === 'system')
32
+ return;
33
+ return (_jsx(Icon, { className: cn(itemVariants({ active: value === key })) }, key));
34
+ }) }));
26
35
  }
27
36
  const value = mounted ? theme : null;
28
- return (_jsx("div", { className: container, "data-theme-toggle": "", ...props, children: [
29
- ['light', Sun],
30
- ['dark', Moon],
31
- ['system', Airplay],
32
- ].map(([key, Icon]) => (_jsx("button", { "aria-label": key, className: cn(itemVariants({ active: value === key })), onClick: () => setTheme(key), children: _jsx(Icon, { className: "size-full" }) }, key))) }));
37
+ return (_jsx("div", { className: container, "data-theme-toggle": "", ...props, children: full.map(([key, Icon]) => (_jsx("button", { "aria-label": key, className: cn(itemVariants({ active: value === key })), onClick: () => setTheme(key), children: _jsx(Icon, { className: "size-full" }) }, key))) }));
33
38
  }
@@ -2,10 +2,10 @@
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import * as Primitive from 'fumadocs-core/toc';
4
4
  import { useEffect, useRef, useState } from 'react';
5
- import { cn } from '../../utils/cn';
6
- import { TocThumb } from '../../components/layout/toc-thumb';
7
- import { ScrollArea, ScrollViewport } from '../ui/scroll-area';
8
- import { TocItemsEmpty } from '../../components/layout/toc';
5
+ import { cn } from '../../utils/cn.js';
6
+ import { TocThumb } from '../../components/layout/toc-thumb.js';
7
+ import { ScrollArea, ScrollViewport } from '../ui/scroll-area.js';
8
+ import { TocItemsEmpty } from '../../components/layout/toc.js';
9
9
  export default function ClerkTOCItems({ items, isMenu = false, }) {
10
10
  const viewRef = useRef(null);
11
11
  const containerRef = useRef(null);
@@ -2,13 +2,13 @@
2
2
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
3
  import * as Primitive from 'fumadocs-core/toc';
4
4
  import { useMemo, useRef } from 'react';
5
- import { cn } from '../../utils/cn';
6
- import { useI18n } from '../../contexts/i18n';
7
- import { TocThumb } from '../../components/layout/toc-thumb';
8
- import { ScrollArea, ScrollViewport } from '../ui/scroll-area';
9
- import { Popover, PopoverContent, PopoverTrigger, } from '../../components/ui/popover';
5
+ import { cn } from '../../utils/cn.js';
6
+ import { useI18n } from '../../contexts/i18n.js';
7
+ import { TocThumb } from '../../components/layout/toc-thumb.js';
8
+ import { ScrollArea, ScrollViewport } from '../ui/scroll-area.js';
9
+ import { Popover, PopoverContent, PopoverTrigger, } from '../../components/ui/popover.js';
10
10
  import { ChevronRight, Text } from 'lucide-react';
11
- import { usePageStyles } from '../../contexts/layout';
11
+ import { usePageStyles } from '../../contexts/layout.js';
12
12
  export function Toc(props) {
13
13
  const { toc } = usePageStyles();
14
14
  return (_jsx("div", { id: "nd-toc", ...props, className: cn('sticky top-[calc(var(--fd-banner-height)+var(--fd-nav-height))] h-[var(--fd-toc-height)] pb-2 pt-12', toc, props.className), style: {
@@ -1,5 +1,5 @@
1
1
  import type { TabsContentProps, TabsProps as BaseProps } from '@radix-ui/react-tabs';
2
- import * as Primitive from './ui/tabs';
2
+ import * as Primitive from './ui/tabs.js';
3
3
  export { Primitive };
4
4
  export interface TabsProps extends BaseProps {
5
5
  /**
@@ -1,8 +1,8 @@
1
1
  'use client';
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { useMemo, useState, createContext, useContext, useRef, useLayoutEffect, useId, useEffect, } from 'react';
4
- import { cn } from '../utils/cn';
5
- import * as Primitive from './ui/tabs';
4
+ import { cn } from '../utils/cn.js';
5
+ import * as Primitive from './ui/tabs.js';
6
6
  export { Primitive };
7
7
  const listeners = new Map();
8
8
  function addChangeListener(id, listener) {
@@ -3,8 +3,8 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { InfoIcon } from 'lucide-react';
4
4
  import Link from 'next/link';
5
5
  import { cva } from 'class-variance-authority';
6
- import { cn } from '../utils/cn';
7
- import { Popover, PopoverContent, PopoverTrigger, } from '../components/ui/popover';
6
+ import { cn } from '../utils/cn.js';
7
+ import { Popover, PopoverContent, PopoverTrigger, } from '../components/ui/popover.js';
8
8
  export function Info({ children }) {
9
9
  return (_jsxs(Popover, { children: [_jsx(PopoverTrigger, { children: _jsx(InfoIcon, { className: "size-4" }) }), _jsx(PopoverContent, { className: "prose max-h-[400px] min-w-[220px] max-w-[400px] overflow-auto text-sm prose-no-margin", children: children })] }));
10
10
  }
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import * as CollapsiblePrimitive from '@radix-ui/react-collapsible';
3
3
  import { forwardRef } from 'react';
4
- import { cn } from '../../utils/cn';
4
+ import { cn } from '../../utils/cn.js';
5
5
  const Collapsible = CollapsiblePrimitive.Root;
6
6
  const CollapsibleTrigger = CollapsiblePrimitive.CollapsibleTrigger;
7
7
  const CollapsibleContent = forwardRef(({ children, ...props }, ref) => {
@@ -2,7 +2,7 @@
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
3
  import * as React from 'react';
4
4
  import * as Primitive from '@radix-ui/react-navigation-menu';
5
- import { cn } from '../../utils/cn';
5
+ import { cn } from '../../utils/cn.js';
6
6
  const NavigationMenu = Primitive.Root;
7
7
  const NavigationMenuList = Primitive.List;
8
8
  const NavigationMenuItem = React.forwardRef(({ className, children, ...props }, ref) => (_jsx(Primitive.NavigationMenuItem, { ref: ref, className: cn('list-none', className), ...props, children: children })));
@@ -2,7 +2,7 @@
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
3
  import * as PopoverPrimitive from '@radix-ui/react-popover';
4
4
  import * as React from 'react';
5
- import { cn } from '../../utils/cn';
5
+ import { cn } from '../../utils/cn.js';
6
6
  const Popover = PopoverPrimitive.Root;
7
7
  const PopoverTrigger = PopoverPrimitive.Trigger;
8
8
  const PopoverContent = React.forwardRef(({ className, align = 'center', sideOffset = 4, ...props }, ref) => (_jsx(PopoverPrimitive.Portal, { children: _jsx(PopoverPrimitive.Content, { ref: ref, align: align, sideOffset: sideOffset, side: "bottom", className: cn('z-50 min-w-[220px] max-w-[98vw] rounded-lg border bg-fd-popover p-2 text-sm text-fd-popover-foreground shadow-lg focus-visible:outline-none data-[state=closed]:animate-fd-popover-out data-[state=open]:animate-fd-popover-in', className), ...props }) })));
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import * as ScrollAreaPrimitive from '@radix-ui/react-scroll-area';
3
3
  import * as React from 'react';
4
- import { cn } from '../../utils/cn';
4
+ import { cn } from '../../utils/cn.js';
5
5
  const ScrollArea = React.forwardRef(({ className, children, ...props }, ref) => (_jsxs(ScrollAreaPrimitive.Root, { ref: ref, className: cn('overflow-hidden', className), ...props, children: [children, _jsx(ScrollAreaPrimitive.Corner, {}), _jsx(ScrollBar, { orientation: "vertical" })] })));
6
6
  ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName;
7
7
  const ScrollViewport = React.forwardRef(({ className, children, ...props }, ref) => (_jsx(ScrollAreaPrimitive.Viewport, { ref: ref, className: cn('size-full rounded-[inherit]', className), ...props, children: children })));
@@ -2,7 +2,7 @@
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
3
  import * as TabsPrimitive from '@radix-ui/react-tabs';
4
4
  import * as React from 'react';
5
- import { cn } from '../../utils/cn';
5
+ import { cn } from '../../utils/cn.js';
6
6
  const Tabs = React.forwardRef((props, ref) => {
7
7
  return (_jsx(TabsPrimitive.Root, { ref: ref, ...props, className: cn('flex flex-col overflow-hidden rounded-xl border bg-fd-card', props.className) }));
8
8
  });
@@ -1,5 +1,5 @@
1
1
  import { type ComponentType, type ReactNode } from 'react';
2
- import type { SearchLink, SharedProps } from '../components/dialog/search';
2
+ import type { SearchLink, SharedProps } from '../components/dialog/search.js';
3
3
  interface HotKey {
4
4
  display: ReactNode;
5
5
  /**
package/dist/i18n.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { type ReactNode } from 'react';
2
- import { type Translations, defaultTranslations, type LocaleItem } from './contexts/i18n';
2
+ import { type Translations, defaultTranslations, type LocaleItem } from './contexts/i18n.js';
3
3
  interface I18nProviderProps {
4
4
  /**
5
5
  * Current locale
package/dist/i18n.js CHANGED
@@ -2,7 +2,7 @@
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
3
  import { useCallback, useRef } from 'react';
4
4
  import { useRouter, usePathname } from 'next/navigation';
5
- import { useI18n, I18nContext, defaultTranslations, } from './contexts/i18n';
5
+ import { useI18n, I18nContext, defaultTranslations, } from './contexts/i18n.js';
6
6
  export function I18nProvider({ locales = [], locale, ...props }) {
7
7
  const context = useI18n();
8
8
  const router = useRouter();
@@ -1,8 +1,8 @@
1
- import { type LinkItemType } from '../../layouts/links';
2
- import { type SidebarProps } from '../../layouts/docs/sidebar';
1
+ import { type LinkItemType } from '../../layouts/links.js';
2
+ import { type SidebarProps } from '../../layouts/docs/sidebar.js';
3
3
  import type { PageTree } from 'fumadocs-core/server';
4
4
  import type { FC, ReactNode } from 'react';
5
- import type { Option } from '../../components/layout/root-toggle';
5
+ import type { Option } from '../../components/layout/root-toggle.js';
6
6
  export declare const layoutVariables: {
7
7
  '--fd-layout-offset': string;
8
8
  };
@@ -1,8 +1,8 @@
1
1
  import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
2
- import { BaseLinkItem } from '../../layouts/links';
3
- import { SidebarFolder, SidebarFolderContent, SidebarFolderLink, SidebarFolderTrigger, SidebarItem, } from '../../layouts/docs/sidebar';
4
- import { cn } from '../../utils/cn';
5
- import { buttonVariants } from '../../components/ui/button';
2
+ import { BaseLinkItem } from '../../layouts/links.js';
3
+ import { SidebarFolder, SidebarFolderContent, SidebarFolderLink, SidebarFolderTrigger, SidebarItem, } from '../../layouts/docs/sidebar.js';
4
+ import { cn } from '../../utils/cn.js';
5
+ import { buttonVariants } from '../../components/ui/button.js';
6
6
  import { notFound } from 'next/navigation';
7
7
  export const layoutVariables = {
8
8
  '--fd-layout-offset': 'max(calc(50vw - var(--fd-layout-width) / 2), 0px)',
@@ -2,7 +2,7 @@ import { type ButtonHTMLAttributes, type HTMLAttributes, type ReactNode } from '
2
2
  import { type LinkProps } from 'fumadocs-core/link';
3
3
  import { type ScrollAreaProps } from '@radix-ui/react-scroll-area';
4
4
  import type { CollapsibleContentProps, CollapsibleTriggerProps } from '@radix-ui/react-collapsible';
5
- import type { SidebarComponents } from '../../layouts/docs/shared';
5
+ import type { SidebarComponents } from '../../layouts/docs/shared.js';
6
6
  export interface SidebarProps extends HTMLAttributes<HTMLElement> {
7
7
  /**
8
8
  * Open folders by default if their level is lower or equal to a specific level
@@ -6,14 +6,14 @@ import { usePathname } from 'next/navigation';
6
6
  import { createContext, useCallback, useContext, useMemo, useRef, useState, } from 'react';
7
7
  import Link from 'fumadocs-core/link';
8
8
  import { useOnChange } from 'fumadocs-core/utils/use-on-change';
9
- import { cn } from '../../utils/cn';
10
- import { ScrollArea, ScrollViewport } from '../../components/ui/scroll-area';
11
- import { isActive } from '../../utils/is-active';
12
- import { Collapsible, CollapsibleContent, CollapsibleTrigger, } from '../../components/ui/collapsible';
13
- import { useSidebar } from '../../contexts/sidebar';
14
- import { buttonVariants } from '../../components/ui/button';
9
+ import { cn } from '../../utils/cn.js';
10
+ import { ScrollArea, ScrollViewport } from '../../components/ui/scroll-area.js';
11
+ import { isActive } from '../../utils/is-active.js';
12
+ import { Collapsible, CollapsibleContent, CollapsibleTrigger, } from '../../components/ui/collapsible.js';
13
+ import { useSidebar } from '../../contexts/sidebar.js';
14
+ import { buttonVariants } from '../../components/ui/button.js';
15
15
  import { cva } from 'class-variance-authority';
16
- import { useTreeContext, useTreePath } from '../../contexts/tree';
16
+ import { useTreeContext, useTreePath } from '../../contexts/tree.js';
17
17
  const itemVariants = cva('relative flex flex-row items-center gap-2 rounded-md p-2 text-start text-fd-muted-foreground [overflow-wrap:anywhere] md:py-1.5 [&_svg]:size-4 [&_svg]:shrink-0', {
18
18
  variants: {
19
19
  active: {
@@ -1,5 +1,5 @@
1
1
  import { type ButtonHTMLAttributes, type HTMLAttributes } from 'react';
2
- import { type LinkItemType } from '../layouts/links';
2
+ import { type LinkItemType } from '../layouts/links.js';
3
3
  interface LinksMenuProps extends ButtonHTMLAttributes<HTMLButtonElement> {
4
4
  items: LinkItemType[];
5
5
  }
@@ -4,14 +4,14 @@ import { ChevronDown, Menu, X } from 'lucide-react';
4
4
  import { useState, } from 'react';
5
5
  import { usePathname } from 'next/navigation';
6
6
  import { useOnChange } from 'fumadocs-core/utils/use-on-change';
7
- import { cn } from '../utils/cn';
8
- import { Popover, PopoverContent, PopoverTrigger, } from '../components/ui/popover';
9
- import { BaseLinkItem } from '../layouts/links';
10
- import { Collapsible, CollapsibleContent, CollapsibleTrigger, } from '../components/ui/collapsible';
7
+ import { cn } from '../utils/cn.js';
8
+ import { Popover, PopoverContent, PopoverTrigger, } from '../components/ui/popover.js';
9
+ import { BaseLinkItem } from '../layouts/links.js';
10
+ import { Collapsible, CollapsibleContent, CollapsibleTrigger, } from '../components/ui/collapsible.js';
11
11
  import { cva } from 'class-variance-authority';
12
- import { buttonVariants } from '../components/ui/button';
13
- import { useSidebar } from '../contexts/sidebar';
14
- import { useNav } from '../components/layout/nav';
12
+ import { buttonVariants } from '../components/ui/button.js';
13
+ import { useSidebar } from '../contexts/sidebar.js';
14
+ import { useNav } from '../components/layout/nav.js';
15
15
  import { SidebarTrigger } from 'fumadocs-core/sidebar';
16
16
  const itemVariants = cva('flex flex-row items-center gap-2 rounded-md px-3 py-2.5 text-fd-muted-foreground transition-colors duration-100 [overflow-wrap:anywhere] hover:bg-fd-accent/50 hover:text-fd-accent-foreground/80 hover:transition-none md:px-2 md:py-1.5 [&_svg]:size-4');
17
17
  export function LinksMenu({ items, ...props }) {
@@ -1,14 +1,14 @@
1
1
  import type { PageTree } from 'fumadocs-core/server';
2
2
  import { type ReactNode, type HTMLAttributes } from 'react';
3
- import { type LinkItemType } from '../layouts/links';
4
- import { type BaseLayoutProps } from './shared';
5
- import { type SidebarOptions } from '../layouts/docs/shared';
3
+ import { type LinkItemType } from '../layouts/links.js';
4
+ import { type BaseLayoutProps } from './shared.js';
5
+ import { type SidebarOptions } from '../layouts/docs/shared.js';
6
6
  export interface DocsLayoutProps extends BaseLayoutProps {
7
7
  tree: PageTree.Root;
8
8
  sidebar?: Partial<SidebarOptions>;
9
9
  containerProps?: HTMLAttributes<HTMLDivElement>;
10
10
  }
11
11
  export declare function DocsLayout({ nav: { enabled: navEnabled, component: navReplace, transparentMode, ...nav }, sidebar: { enabled: sidebarEnabled, collapsible, component: sidebarReplace, tabs: tabOptions, banner: sidebarBanner, footer: sidebarFooter, components: sidebarComponents, hideSearch: sidebarHideSearch, ...sidebar }, i18n, ...props }: DocsLayoutProps): ReactNode;
12
- export { getSidebarTabsFromOptions, type TabOptions } from './docs/shared';
12
+ export { getSidebarTabsFromOptions, type TabOptions } from './docs/shared.js';
13
13
  export { type LinkItemType };
14
14
  //# sourceMappingURL=docs.d.ts.map