@fumadocs/base-ui 16.3.2 → 16.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -14,10 +14,11 @@ export type { SharedProps };
14
14
  export interface SearchDialogProps extends SharedProps {
15
15
  search: string;
16
16
  onSearchChange: (v: string) => void;
17
+ onSelect?: (item: SearchItemType) => void;
17
18
  isLoading?: boolean;
18
19
  children: ReactNode;
19
20
  }
20
- export declare function SearchDialog({ open, onOpenChange, search, onSearchChange, isLoading, children, }: SearchDialogProps): import("react/jsx-runtime").JSX.Element;
21
+ export declare function SearchDialog({ open, onOpenChange, search, onSearchChange, isLoading, onSelect: onSelectProp, children, }: SearchDialogProps): import("react/jsx-runtime").JSX.Element;
21
22
  export declare function SearchDialogHeader(props: ComponentProps<'div'>): import("react/jsx-runtime").JSX.Element;
22
23
  export declare function SearchDialogInput(props: ComponentProps<'input'>): import("react/jsx-runtime").JSX.Element;
23
24
  export declare function SearchDialogClose({ children, className, ...props }: ComponentProps<'button'>): import("react/jsx-runtime").JSX.Element;
@@ -58,6 +59,7 @@ export declare function useSearch(): {
58
59
  onOpenChange: (open: boolean) => void;
59
60
  search: string;
60
61
  onSearchChange: (v: string) => void;
62
+ onSelect: (item: SearchItemType) => void;
61
63
  isLoading: boolean;
62
64
  };
63
65
  export declare function useTagsList(): {
@@ -1 +1 @@
1
- {"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../../src/components/dialog/search.tsx"],"names":[],"mappings":"AAGA,OAAO,EACL,KAAK,cAAc,EAGnB,KAAK,SAAS,EAQf,MAAM,OAAO,CAAC;AAGf,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,KAAK,EACV,eAAe,EACf,iBAAiB,IAAI,cAAc,EACpC,MAAM,sBAAsB,CAAC;AAG9B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAKrD,MAAM,MAAM,cAAc,GACtB,CAA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odtC"}
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
3
  import { ChevronRight, Hash, Search as SearchIcon } from '@fumadocs/ui/icons';
4
- import { createContext, Fragment, useCallback, useContext, useEffect, useEffectEvent, useMemo, useRef, useState, } from 'react';
4
+ import { createContext, Fragment, use, useCallback, useEffect, useEffectEvent, useMemo, useRef, useState, } from 'react';
5
5
  import { I18nLabel, useI18n } from '../../contexts/i18n.js';
6
6
  import { cn } from '@fumadocs/ui/cn';
7
7
  import { Dialog } from '@base-ui/react/dialog';
@@ -13,17 +13,30 @@ import { buttonVariants } from '../../components/ui/button.js';
13
13
  const Context = createContext(null);
14
14
  const ListContext = createContext(null);
15
15
  const TagsListContext = createContext(null);
16
- export function SearchDialog({ open, onOpenChange, search, onSearchChange, isLoading = false, children, }) {
17
- const [active, setActive] = useState(null);
16
+ export function SearchDialog({ open, onOpenChange, search, onSearchChange, isLoading = false, onSelect: onSelectProp, children, }) {
17
+ const router = useRouter();
18
+ const onSelect = useEffectEvent((item) => {
19
+ if (item.type === 'action') {
20
+ item.onSelect();
21
+ }
22
+ else if (item.external) {
23
+ window.open(item.url, '_blank')?.focus();
24
+ }
25
+ else {
26
+ router.push(item.url);
27
+ }
28
+ onOpenChange(false);
29
+ onSelectProp?.(item);
30
+ });
18
31
  return (_jsx(Dialog.Root, { open: open, onOpenChange: onOpenChange, children: _jsx(Context.Provider, { value: useMemo(() => ({
19
32
  open,
20
33
  onOpenChange,
21
34
  search,
22
35
  onSearchChange,
23
- active,
24
- setActive,
36
+ // eslint-disable-next-line react-hooks/rules-of-hooks -- used in child components
37
+ onSelect,
25
38
  isLoading,
26
- }), [active, isLoading, onOpenChange, onSearchChange, open, search]), children: children }) }));
39
+ }), [isLoading, onOpenChange, onSearchChange, open, search]), children: children }) }));
27
40
  }
28
41
  export function SearchDialogHeader(props) {
29
42
  return (_jsx("div", { ...props, className: cn('flex flex-row items-center gap-2 p-3', props.className) }));
@@ -53,21 +66,8 @@ export function SearchDialogContent({ children, className, ...props }) {
53
66
  }
54
67
  export function SearchDialogList({ items = null, Empty = () => (_jsx("div", { className: "py-12 text-center text-sm text-fd-muted-foreground", children: _jsx(I18nLabel, { label: "searchNoResult" }) })), Item = (props) => _jsx(SearchDialogListItem, { ...props }), ...props }) {
55
68
  const ref = useRef(null);
69
+ const { onSelect } = useSearch();
56
70
  const [active, setActive] = useState(() => items && items.length > 0 ? items[0].id : null);
57
- const { onOpenChange } = useSearch();
58
- const router = useRouter();
59
- const onOpen = (item) => {
60
- if (item.type === 'action') {
61
- item.onSelect();
62
- }
63
- else if (item.external) {
64
- window.open(item.url, '_blank')?.focus();
65
- }
66
- else {
67
- router.push(item.url);
68
- }
69
- onOpenChange(false);
70
- };
71
71
  const onKey = useEffectEvent((e) => {
72
72
  if (!items || e.isComposing)
73
73
  return;
@@ -85,7 +85,7 @@ export function SearchDialogList({ items = null, Empty = () => (_jsx("div", { cl
85
85
  if (e.key === 'Enter') {
86
86
  const selected = items.find((item) => item.id === active);
87
87
  if (selected)
88
- onOpen(selected);
88
+ onSelect(selected);
89
89
  e.preventDefault();
90
90
  }
91
91
  });
@@ -114,7 +114,7 @@ export function SearchDialogList({ items = null, Empty = () => (_jsx("div", { cl
114
114
  return (_jsx("div", { ...props, ref: ref, "data-empty": items === null, className: cn('overflow-hidden h-(--fd-animated-height) transition-[height]', props.className), children: _jsx("div", { className: cn('w-full flex flex-col overflow-y-auto max-h-[460px] p-1', !items && 'hidden'), children: _jsxs(ListContext.Provider, { value: useMemo(() => ({
115
115
  active,
116
116
  setActive,
117
- }), [active]), children: [items?.length === 0 && Empty(), items?.map((item) => (_jsx(Fragment, { children: Item({ item, onClick: () => onOpen(item) }) }, item.id)))] }) }) }));
117
+ }), [active]), children: [items?.length === 0 && Empty(), items?.map((item) => (_jsx(Fragment, { children: Item({ item, onClick: () => onSelect(item) }) }, item.id)))] }) }) }));
118
118
  }
119
119
  export function SearchDialogListItem({ item, className, children, renderHighlights: render = renderHighlights, ...props }) {
120
120
  const { active: activeId, setActive } = useSearchList();
@@ -123,7 +123,7 @@ export function SearchDialogListItem({ item, className, children, renderHighligh
123
123
  children ?? (children = item.node);
124
124
  }
125
125
  else {
126
- children ?? (children = _jsxs(_Fragment, { children: [_jsx("div", { className: "inline-flex items-center text-fd-muted-foreground text-xs empty:hidden", children: item.breadcrumbs?.map((item, i) => (_jsxs(Fragment, { children: [i > 0 && _jsx(ChevronRight, { className: "size-4" }), item] }, i))) }), item.type !== 'page' && (_jsx("div", { role: "none", className: "absolute start-3 inset-y-0 w-px bg-fd-border" })), _jsxs("p", { className: cn('min-w-0 truncate', item.type !== 'page' && 'ps-4', item.type === 'page' || item.type === 'heading'
126
+ children ?? (children = _jsxs(_Fragment, { children: [_jsx("div", { className: "inline-flex items-center text-fd-muted-foreground text-xs empty:hidden", children: item.breadcrumbs?.map((item, i) => (_jsxs(Fragment, { children: [i > 0 && _jsx(ChevronRight, { className: "size-4 rtl:rotate-180" }), item] }, i))) }), item.type !== 'page' && (_jsx("div", { role: "none", className: "absolute start-3 inset-y-0 w-px bg-fd-border" })), _jsxs("p", { className: cn('min-w-0 truncate', item.type !== 'page' && 'ps-4', item.type === 'page' || item.type === 'heading'
127
127
  ? 'font-medium'
128
128
  : 'text-fd-popover-foreground/80'), children: [item.type === 'heading' && (_jsx(Hash, { className: "inline me-1 size-4 text-fd-muted-foreground" })), item.contentWithHighlights
129
129
  ? render(item.contentWithHighlights)
@@ -173,19 +173,19 @@ function renderHighlights(highlights) {
173
173
  });
174
174
  }
175
175
  export function useSearch() {
176
- const ctx = useContext(Context);
176
+ const ctx = use(Context);
177
177
  if (!ctx)
178
178
  throw new Error('Missing <SearchDialog />');
179
179
  return ctx;
180
180
  }
181
181
  export function useTagsList() {
182
- const ctx = useContext(TagsListContext);
182
+ const ctx = use(TagsListContext);
183
183
  if (!ctx)
184
184
  throw new Error('Missing <TagsList />');
185
185
  return ctx;
186
186
  }
187
187
  export function useSearchList() {
188
- const ctx = useContext(ListContext);
188
+ const ctx = use(ListContext);
189
189
  if (!ctx)
190
190
  throw new Error('Missing <SearchDialogList />');
191
191
  return ctx;
@@ -1,6 +1,10 @@
1
1
  import * as Base from '../../components/sidebar/base.js';
2
2
  import { type ComponentProps } from 'react';
3
- export declare const Sidebar: typeof Base.SidebarProvider, SidebarFolder: typeof Base.SidebarFolder, SidebarCollapseTrigger: typeof Base.SidebarCollapseTrigger, SidebarViewport: typeof Base.SidebarViewport, SidebarTrigger: typeof Base.SidebarTrigger;
3
+ export declare function Sidebar(props: ComponentProps<typeof Base.SidebarProvider>): import("react/jsx-runtime").JSX.Element;
4
+ export declare function SidebarFolder(props: ComponentProps<typeof Base.SidebarFolder>): import("react/jsx-runtime").JSX.Element;
5
+ export declare function SidebarCollapseTrigger(props: ComponentProps<typeof Base.SidebarCollapseTrigger>): import("react/jsx-runtime").JSX.Element;
6
+ export declare function SidebarViewport(props: ComponentProps<typeof Base.SidebarViewport>): import("react/jsx-runtime").JSX.Element;
7
+ export declare function SidebarTrigger(props: ComponentProps<typeof Base.SidebarTrigger>): import("react/jsx-runtime").JSX.Element;
4
8
  export declare function SidebarContent({ ref: refProp, className, children, ...props }: ComponentProps<'aside'>): import("react/jsx-runtime").JSX.Element;
5
9
  export declare function SidebarDrawer({ children, className, ...props }: ComponentProps<typeof Base.SidebarDrawerContent>): import("react/jsx-runtime").JSX.Element;
6
10
  export declare function SidebarSeparator({ className, style, children, ...props }: ComponentProps<'p'>): import("react/jsx-runtime").JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"sidebar.d.ts","sourceRoot":"","sources":["../../../src/layouts/docs/sidebar.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,IAAI,MAAM,2BAA2B,CAAC;AAElD,OAAO,EAAE,KAAK,cAAc,EAAU,MAAM,OAAO,CAAC;AA6BpD,eAAO,MACY,OAAO,+BACxB,aAAa,6BACb,sBAAsB,sCACtB,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C;AAED,wBAAgB,oBAAoB,CAAC,EACnC,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,OAAO,IAAI,CAAC,oBAAoB,CAAC,2CAkBlD;AAED,eAAO,MAAM,eAAe,sIAO1B,CAAC;AAEH,eAAO,MAAM,eAAe;;;;6CAM1B,CAAC"}
@@ -24,7 +24,21 @@ const itemVariants = cva('relative flex flex-row items-center gap-2 rounded-lg p
24
24
  function getItemOffset(depth) {
25
25
  return `calc(${2 + 3 * depth} * var(--spacing))`;
26
26
  }
27
- export const { SidebarProvider: Sidebar, SidebarFolder, SidebarCollapseTrigger, SidebarViewport, SidebarTrigger, } = Base;
27
+ export function Sidebar(props) {
28
+ return _jsx(Base.SidebarProvider, { ...props });
29
+ }
30
+ export function SidebarFolder(props) {
31
+ return _jsx(Base.SidebarFolder, { ...props });
32
+ }
33
+ export function SidebarCollapseTrigger(props) {
34
+ return _jsx(Base.SidebarCollapseTrigger, { ...props });
35
+ }
36
+ export function SidebarViewport(props) {
37
+ return _jsx(Base.SidebarViewport, { ...props });
38
+ }
39
+ export function SidebarTrigger(props) {
40
+ return _jsx(Base.SidebarTrigger, { ...props });
41
+ }
28
42
  export function SidebarContent({ ref: refProp, className, children, ...props }) {
29
43
  const ref = useRef(null);
30
44
  return (_jsx(Base.SidebarContent, { children: ({ collapsed, hovered, ref: asideRef, ...rest }) => (_jsxs(_Fragment, { children: [_jsxs("div", { "data-sidebar-placeholder": "", className: "sticky top-(--fd-docs-row-1) z-20 [grid-area:sidebar] pointer-events-none *:pointer-events-auto h-[calc(var(--fd-docs-height)-var(--fd-docs-row-1))] md:layout:[--fd-sidebar-width:268px] max-md:hidden", children: [collapsed && (_jsx("div", { className: "absolute start-0 inset-y-0 w-4", ...rest })), _jsx("aside", { id: "nd-sidebar", ref: mergeRefs(ref, refProp, asideRef), "data-collapsed": collapsed, "data-hovered": collapsed && hovered, className: cn('absolute flex flex-col w-full start-0 inset-y-0 items-end bg-fd-card text-sm border-e duration-250 *:w-(--fd-sidebar-width)', collapsed && [
@@ -35,7 +49,7 @@ export function SidebarContent({ ref: refProp, className, children, ...props })
35
49
  ], ref.current &&
36
50
  (ref.current.getAttribute('data-collapsed') === 'true') !==
37
51
  collapsed &&
38
- 'transition-[width,inset-block,translate,background-color]', className), ...props, ...rest, children: children })] }), _jsxs("div", { "data-sidebar-panel": "", className: cn('fixed flex top-[calc(--spacing(4)+var(--fd-docs-row-3))] start-4 shadow-lg transition-opacity rounded-xl p-0.5 border bg-fd-muted text-fd-muted-foreground z-10', (!collapsed || hovered) && 'pointer-events-none opacity-0'), children: [_jsx(SidebarCollapseTrigger, { className: cn(buttonVariants({
52
+ 'transition-[width,inset-block,translate,background-color]', className), ...props, ...rest, children: children })] }), _jsxs("div", { "data-sidebar-panel": "", className: cn('fixed flex top-[calc(--spacing(4)+var(--fd-docs-row-3))] start-4 shadow-lg transition-opacity rounded-xl p-0.5 border bg-fd-muted text-fd-muted-foreground z-10', (!collapsed || hovered) && 'pointer-events-none opacity-0'), children: [_jsx(Base.SidebarCollapseTrigger, { className: cn(buttonVariants({
39
53
  color: 'ghost',
40
54
  size: 'icon-sm',
41
55
  className: 'rounded-lg',
package/dist/style.css CHANGED
@@ -317,6 +317,9 @@
317
317
  .top-\(--fd-docs-row-3\) {
318
318
  top: var(--fd-docs-row-3);
319
319
  }
320
+ .top-\(--fd-top\) {
321
+ top: var(--fd-top);
322
+ }
320
323
  .top-0 {
321
324
  top: calc(var(--spacing) * 0);
322
325
  }
@@ -1705,6 +1708,11 @@
1705
1708
  transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
1706
1709
  transition-duration: var(--tw-duration, var(--default-transition-duration));
1707
1710
  }
1711
+ .transition-\[top\,height\] {
1712
+ transition-property: top,height;
1713
+ transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
1714
+ transition-duration: var(--tw-duration, var(--default-transition-duration));
1715
+ }
1708
1716
  .transition-\[translate\,height\] {
1709
1717
  transition-property: translate,height;
1710
1718
  transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
@@ -1763,6 +1771,10 @@
1763
1771
  --tw-ease: var(--easing);
1764
1772
  transition-timing-function: var(--easing);
1765
1773
  }
1774
+ .ease-linear {
1775
+ --tw-ease: linear;
1776
+ transition-timing-function: linear;
1777
+ }
1766
1778
  .ease-out {
1767
1779
  --tw-ease: var(--ease-out);
1768
1780
  transition-timing-function: var(--ease-out);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fumadocs/base-ui",
3
- "version": "16.3.2",
3
+ "version": "16.4.1",
4
4
  "description": "The Base UI version of Fumadocs UI",
5
5
  "keywords": [
6
6
  "Fumadocs",
@@ -88,8 +88,8 @@
88
88
  "next-themes": "^0.4.6",
89
89
  "react-medium-image-zoom": "^5.4.0",
90
90
  "scroll-into-view-if-needed": "^3.1.0",
91
- "@fumadocs/ui": "16.3.2",
92
- "fumadocs-core": "16.3.2"
91
+ "@fumadocs/ui": "16.4.1",
92
+ "fumadocs-core": "16.4.1"
93
93
  },
94
94
  "devDependencies": {
95
95
  "@tailwindcss/cli": "^4.1.18",
@@ -100,7 +100,7 @@
100
100
  "tsc-alias": "^1.8.16",
101
101
  "@fumadocs/cli": "1.2.0",
102
102
  "eslint-config-custom": "0.0.0",
103
- "fumadocs-core": "16.3.2",
103
+ "fumadocs-core": "16.4.1",
104
104
  "tsconfig": "0.0.0"
105
105
  },
106
106
  "peerDependencies": {