@vx-oss/docs-react 1.0.4 → 1.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.
- package/README.md +3 -3
- package/css/generated/docs.css +1 -1
- package/css/generated/flux.css +1 -1
- package/css/generated/glass.css +1 -1
- package/css/generated/home.css +1 -1
- package/css/generated/notebook.css +1 -1
- package/css/generated/shared.css +1 -1
- package/css/lib/base.css +0 -127
- package/css/preset.css +1 -2
- package/css/style.css +1 -0
- package/dist/components/accordion.js +1 -68
- package/dist/components/banner.js +1 -85
- package/dist/components/callout.js +1 -60
- package/dist/components/card.js +1 -39
- package/dist/components/codeblock.js +1 -126
- package/dist/components/codeblock.rsc.js +1 -22
- package/dist/components/dialog/search-algolia.js +2 -64
- package/dist/components/dialog/search-default.js +2 -66
- package/dist/components/dialog/search-orama.js +2 -69
- package/dist/components/dialog/search.js +1 -351
- package/dist/components/dynamic-codeblock.core.js +1 -51
- package/dist/components/dynamic-codeblock.js +1 -17
- package/dist/components/files.js +1 -40
- package/dist/components/github-info.js +1 -75
- package/dist/components/heading.js +1 -38
- package/dist/components/image-zoom.js +1 -32
- package/dist/components/inline-toc.js +1 -28
- package/dist/components/sidebar/base.js +1 -277
- package/dist/components/sidebar/link-item.js +1 -37
- package/dist/components/sidebar/page-tree.js +1 -69
- package/dist/components/sidebar/tabs/dropdown.js +1 -83
- package/dist/components/sidebar/tabs/index.js +1 -46
- package/dist/components/steps.js +1 -16
- package/dist/components/tabs.js +1 -95
- package/dist/components/toc/clerk.js +1 -227
- package/dist/components/toc/default.js +1 -260
- package/dist/components/toc/index.js +1 -45
- package/dist/components/type-table.js +1 -117
- package/dist/components/ui/accordion.js +1 -42
- package/dist/components/ui/button.js +1 -20
- package/dist/components/ui/collapsible.js +1 -21
- package/dist/components/ui/popover.js +1 -20
- package/dist/components/ui/scroll-area.js +1 -34
- package/dist/components/ui/tabs.js +1 -102
- package/dist/contexts/i18n.js +1 -37
- package/dist/contexts/search.js +1 -68
- package/dist/contexts/tree.js +1 -91
- package/dist/i18n.js +1 -38
- package/dist/index.js +1 -0
- package/dist/layouts/docs/index.js +1 -23
- package/dist/layouts/docs/page/index.js +1 -124
- package/dist/layouts/docs/page/slots/breadcrumb.js +1 -44
- package/dist/layouts/docs/page/slots/container.js +1 -22
- package/dist/layouts/docs/page/slots/footer.js +1 -56
- package/dist/layouts/docs/page/slots/toc.js +1 -182
- package/dist/layouts/docs/slots/container.js +1 -36
- package/dist/layouts/docs/slots/header.js +1 -38
- package/dist/layouts/docs/slots/sidebar.js +1 -268
- package/dist/layouts/flux/index.js +1 -146
- package/dist/layouts/flux/page/index.js +1 -104
- package/dist/layouts/flux/page/slots/breadcrumb.js +1 -44
- package/dist/layouts/flux/page/slots/container.js +1 -22
- package/dist/layouts/flux/page/slots/footer.js +1 -56
- package/dist/layouts/flux/page/slots/toc.js +1 -181
- package/dist/layouts/flux/slots/container.js +1 -13
- package/dist/layouts/flux/slots/sidebar.js +1 -243
- package/dist/layouts/flux/slots/tab-dropdown.js +1 -88
- package/dist/layouts/glass/index.js +1 -70
- package/dist/layouts/glass/page/index.js +1 -92
- package/dist/layouts/glass/page/slots/breadcrumb.js +1 -44
- package/dist/layouts/glass/page/slots/footer.js +1 -56
- package/dist/layouts/glass/page/slots/toc.js +1 -108
- package/dist/layouts/glass/slots/header.js +1 -68
- package/dist/layouts/glass/slots/sidebar.js +1 -267
- package/dist/layouts/home/index.js +1 -40
- package/dist/layouts/home/navbar.js +1 -34
- package/dist/layouts/home/not-found.js +1 -41
- package/dist/layouts/home/slots/container.js +1 -13
- package/dist/layouts/home/slots/header.js +1 -239
- package/dist/layouts/notebook/index.js +1 -23
- package/dist/layouts/notebook/page/index.js +1 -124
- package/dist/layouts/notebook/page/slots/breadcrumb.js +1 -44
- package/dist/layouts/notebook/page/slots/container.js +1 -22
- package/dist/layouts/notebook/page/slots/footer.js +1 -56
- package/dist/layouts/notebook/page/slots/toc.js +1 -181
- package/dist/layouts/notebook/slots/container.js +1 -38
- package/dist/layouts/notebook/slots/header.js +1 -204
- package/dist/layouts/notebook/slots/sidebar.js +1 -240
- package/dist/layouts/shared/index.js +1 -98
- package/dist/layouts/shared/slots/language-select.js +1 -43
- package/dist/layouts/shared/slots/search-trigger.js +1 -53
- package/dist/layouts/shared/slots/theme-switch.js +1 -70
- package/dist/mdx.d.ts +2 -44
- package/dist/mdx.js +2 -70
- package/dist/mdx.server.js +2 -20
- package/dist/og/takumi.js +1 -91
- package/dist/og.js +1 -91
- package/dist/page.js +1 -33
- package/dist/primitives/accordion.js +1 -0
- package/dist/primitives/collapsible.js +1 -0
- package/dist/primitives/dialog.js +1 -0
- package/dist/primitives/direction-provider.js +1 -0
- package/dist/primitives/drawer.js +1 -0
- package/dist/primitives/navigation-menu.js +1 -0
- package/dist/primitives/popover.js +1 -0
- package/dist/primitives/scroll-area.js +1 -0
- package/dist/primitives/shared.js +1 -0
- package/dist/primitives/tabs.js +1 -0
- package/dist/provider/astro.js +1 -20
- package/dist/provider/base.js +1 -73
- package/dist/provider/next.js +1 -17
- package/dist/provider/react-router.js +1 -17
- package/dist/provider/tanstack.js +1 -17
- package/dist/provider/waku.js +1 -17
- package/dist/style.css +11577 -310
- package/dist/utils/use-copy-button.js +1 -26
- package/dist/utils/use-footer-items.js +1 -24
- package/dist/utils/use-is-scroll-top.js +1 -20
- package/package.json +28 -66
- package/css/preset-legacy.css +0 -43
- package/dist/.translations/index.d.ts +0 -55
- package/dist/.translations/keys.js +0 -55
- package/dist/_virtual/_rolldown/runtime.js +0 -13
- package/dist/components/accordion.d.ts +0 -10
- package/dist/components/banner.d.ts +0 -25
- package/dist/components/callout.d.ts +0 -21
- package/dist/components/card.d.ts +0 -13
- package/dist/components/codeblock.d.ts +0 -45
- package/dist/components/codeblock.rsc.d.ts +0 -15
- package/dist/components/dialog/search-algolia.d.ts +0 -27
- package/dist/components/dialog/search-default.d.ts +0 -29
- package/dist/components/dialog/search-orama.d.ts +0 -32
- package/dist/components/dialog/search.d.ts +0 -76
- package/dist/components/dynamic-codeblock.core.d.ts +0 -26
- package/dist/components/dynamic-codeblock.d.ts +0 -8
- package/dist/components/files.d.ts +0 -21
- package/dist/components/github-info.d.ts +0 -20
- package/dist/components/heading.d.ts +0 -9
- package/dist/components/image-zoom.d.ts +0 -18
- package/dist/components/inline-toc.d.ts +0 -10
- package/dist/components/sidebar/base.d.ts +0 -85
- package/dist/components/sidebar/link-item.d.ts +0 -12
- package/dist/components/sidebar/page-tree.d.ts +0 -20
- package/dist/components/sidebar/tabs/dropdown.d.ts +0 -15
- package/dist/components/sidebar/tabs/index.d.ts +0 -8
- package/dist/components/steps.d.ts +0 -10
- package/dist/components/tabs.d.ts +0 -33
- package/dist/components/toc/clerk.d.ts +0 -11
- package/dist/components/toc/default.d.ts +0 -13
- package/dist/components/toc/index.d.ts +0 -10
- package/dist/components/type-table.d.ts +0 -37
- package/dist/components/ui/accordion.d.ts +0 -10
- package/dist/components/ui/button.d.ts +0 -10
- package/dist/components/ui/collapsible.d.ts +0 -11
- package/dist/components/ui/navigation-menu.d.ts +0 -14
- package/dist/components/ui/navigation-menu.js +0 -41
- package/dist/components/ui/popover.d.ts +0 -9
- package/dist/components/ui/scroll-area.d.ts +0 -9
- package/dist/components/ui/tabs.d.ts +0 -23
- package/dist/contexts/i18n.d.ts +0 -34
- package/dist/contexts/search.d.ts +0 -64
- package/dist/contexts/tree.d.ts +0 -29
- package/dist/i18n.d.ts +0 -15
- package/dist/layouts/docs/client.d.ts +0 -33
- package/dist/layouts/docs/client.js +0 -94
- package/dist/layouts/docs/index.d.ts +0 -32
- package/dist/layouts/docs/page/index.d.ts +0 -76
- package/dist/layouts/docs/page/slots/breadcrumb.d.ts +0 -7
- package/dist/layouts/docs/page/slots/container.d.ts +0 -5
- package/dist/layouts/docs/page/slots/footer.d.ts +0 -16
- package/dist/layouts/docs/page/slots/toc.d.ts +0 -47
- package/dist/layouts/docs/slots/container.d.ts +0 -5
- package/dist/layouts/docs/slots/header.d.ts +0 -5
- package/dist/layouts/docs/slots/sidebar.d.ts +0 -22
- package/dist/layouts/flux/index.d.ts +0 -61
- package/dist/layouts/flux/page/index.d.ts +0 -67
- package/dist/layouts/flux/page/slots/breadcrumb.d.ts +0 -7
- package/dist/layouts/flux/page/slots/container.d.ts +0 -5
- package/dist/layouts/flux/page/slots/footer.d.ts +0 -16
- package/dist/layouts/flux/page/slots/toc.d.ts +0 -29
- package/dist/layouts/flux/slots/container.d.ts +0 -5
- package/dist/layouts/flux/slots/sidebar.d.ts +0 -16
- package/dist/layouts/flux/slots/tab-dropdown.d.ts +0 -10
- package/dist/layouts/glass/index.d.ts +0 -39
- package/dist/layouts/glass/layout-tabs.js +0 -54
- package/dist/layouts/glass/page/index.d.ts +0 -31
- package/dist/layouts/glass/page/slots/breadcrumb.d.ts +0 -7
- package/dist/layouts/glass/page/slots/footer.d.ts +0 -16
- package/dist/layouts/glass/page/slots/toc.d.ts +0 -19
- package/dist/layouts/glass/slots/header.d.ts +0 -6
- package/dist/layouts/glass/slots/sidebar.d.ts +0 -21
- package/dist/layouts/home/index.d.ts +0 -27
- package/dist/layouts/home/navbar.d.ts +0 -9
- package/dist/layouts/home/not-found.d.ts +0 -7
- package/dist/layouts/home/slots/container.d.ts +0 -5
- package/dist/layouts/home/slots/header.d.ts +0 -8
- package/dist/layouts/notebook/client.d.ts +0 -35
- package/dist/layouts/notebook/client.js +0 -69
- package/dist/layouts/notebook/index.d.ts +0 -26
- package/dist/layouts/notebook/page/index.d.ts +0 -76
- package/dist/layouts/notebook/page/slots/breadcrumb.d.ts +0 -7
- package/dist/layouts/notebook/page/slots/container.d.ts +0 -5
- package/dist/layouts/notebook/page/slots/footer.d.ts +0 -16
- package/dist/layouts/notebook/page/slots/toc.d.ts +0 -47
- package/dist/layouts/notebook/slots/container.d.ts +0 -5
- package/dist/layouts/notebook/slots/header.d.ts +0 -5
- package/dist/layouts/notebook/slots/sidebar.d.ts +0 -23
- package/dist/layouts/shared/client.d.ts +0 -37
- package/dist/layouts/shared/client.js +0 -85
- package/dist/layouts/shared/index.d.ts +0 -169
- package/dist/layouts/shared/page-actions.d.ts +0 -27
- package/dist/layouts/shared/page-actions.js +0 -199
- package/dist/layouts/shared/slots/language-select.d.ts +0 -12
- package/dist/layouts/shared/slots/search-trigger.d.ts +0 -13
- package/dist/layouts/shared/slots/theme-switch.d.ts +0 -8
- package/dist/legacy/layout.d.ts +0 -29
- package/dist/legacy/layout.js +0 -44
- package/dist/legacy/sidebar.d.ts +0 -14
- package/dist/legacy/sidebar.js +0 -34
- package/dist/mdx.server.d.ts +0 -14
- package/dist/node_modules/.pnpm/react-medium-image-zoom@5.4.9_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/react-medium-image-zoom/dist/controlled.d.ts +0 -30
- package/dist/node_modules/.pnpm/react-medium-image-zoom@5.4.9_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/react-medium-image-zoom/dist/controlled.js +0 -461
- package/dist/node_modules/.pnpm/react-medium-image-zoom@5.4.9_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/react-medium-image-zoom/dist/index.d.ts +0 -3
- package/dist/node_modules/.pnpm/react-medium-image-zoom@5.4.9_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/react-medium-image-zoom/dist/uncontrolled.d.ts +0 -6
- package/dist/node_modules/.pnpm/react-medium-image-zoom@5.4.9_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/react-medium-image-zoom/dist/uncontrolled.js +0 -17
- package/dist/node_modules/.pnpm/react-medium-image-zoom@5.4.9_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/react-medium-image-zoom/dist/utils/adjust-svg-ids.js +0 -53
- package/dist/node_modules/.pnpm/react-medium-image-zoom@5.4.9_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/react-medium-image-zoom/dist/utils/compute-positioned-style.js +0 -25
- package/dist/node_modules/.pnpm/react-medium-image-zoom@5.4.9_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/react-medium-image-zoom/dist/utils/element-tests.js +0 -12
- package/dist/node_modules/.pnpm/react-medium-image-zoom@5.4.9_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/react-medium-image-zoom/dist/utils/get-div-img-style.js +0 -45
- package/dist/node_modules/.pnpm/react-medium-image-zoom@5.4.9_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/react-medium-image-zoom/dist/utils/get-img-alt.js +0 -10
- package/dist/node_modules/.pnpm/react-medium-image-zoom@5.4.9_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/react-medium-image-zoom/dist/utils/get-img-object-fit-style.js +0 -57
- package/dist/node_modules/.pnpm/react-medium-image-zoom@5.4.9_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/react-medium-image-zoom/dist/utils/get-img-regular-style.js +0 -21
- package/dist/node_modules/.pnpm/react-medium-image-zoom@5.4.9_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/react-medium-image-zoom/dist/utils/get-img-src.js +0 -14
- package/dist/node_modules/.pnpm/react-medium-image-zoom@5.4.9_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/react-medium-image-zoom/dist/utils/get-modal-img-transform.js +0 -22
- package/dist/node_modules/.pnpm/react-medium-image-zoom@5.4.9_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/react-medium-image-zoom/dist/utils/get-scale.js +0 -27
- package/dist/node_modules/.pnpm/react-medium-image-zoom@5.4.9_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/react-medium-image-zoom/dist/utils/get-style-ghost.js +0 -31
- package/dist/node_modules/.pnpm/react-medium-image-zoom@5.4.9_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/react-medium-image-zoom/dist/utils/get-style-modal-img.js +0 -75
- package/dist/node_modules/.pnpm/react-medium-image-zoom@5.4.9_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/react-medium-image-zoom/dist/utils/get-target-dimension.js +0 -4
- package/dist/node_modules/.pnpm/react-medium-image-zoom@5.4.9_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/react-medium-image-zoom/dist/utils/parse-position.js +0 -7
- package/dist/node_modules/.pnpm/react-medium-image-zoom@5.4.9_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/react-medium-image-zoom/dist/utils/test-has-scalable-src.js +0 -5
- package/dist/og/takumi.d.ts +0 -15
- package/dist/og.d.ts +0 -16
- package/dist/page.d.ts +0 -29
- package/dist/provider/astro.d.ts +0 -29
- package/dist/provider/base.d.ts +0 -48
- package/dist/provider/next.d.ts +0 -16
- package/dist/provider/react-router.d.ts +0 -16
- package/dist/provider/tanstack.d.ts +0 -16
- package/dist/provider/waku.d.ts +0 -16
- package/dist/utils/cn.js +0 -2
- package/dist/utils/merge-refs.js +0 -11
- package/dist/utils/urls.js +0 -15
- package/dist/utils/use-copy-button.d.ts +0 -5
- package/dist/utils/use-footer-items.d.ts +0 -8
- package/dist/utils/use-is-scroll-top.d.ts +0 -6
package/dist/contexts/i18n.d.ts
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from "react";
|
|
2
|
-
//#region src/contexts/i18n.d.ts
|
|
3
|
-
interface LocaleItem {
|
|
4
|
-
name: string;
|
|
5
|
-
locale: string;
|
|
6
|
-
}
|
|
7
|
-
interface LocaleContextType {
|
|
8
|
-
locale?: string;
|
|
9
|
-
onChange?: (v: string) => void;
|
|
10
|
-
locales?: LocaleItem[];
|
|
11
|
-
}
|
|
12
|
-
declare function useI18n(): LocaleContextType;
|
|
13
|
-
interface I18nProviderProps {
|
|
14
|
-
/**
|
|
15
|
-
* Current locale
|
|
16
|
-
*/
|
|
17
|
-
locale?: string;
|
|
18
|
-
/**
|
|
19
|
-
* Handle changes to the locale, redirect user when not specified.
|
|
20
|
-
*/
|
|
21
|
-
onLocaleChange?: (v: string) => void;
|
|
22
|
-
/**
|
|
23
|
-
* Translations of current locale
|
|
24
|
-
*/
|
|
25
|
-
translations?: Partial<Record<string, string>>;
|
|
26
|
-
/**
|
|
27
|
-
* Available languages
|
|
28
|
-
*/
|
|
29
|
-
locales?: LocaleItem[];
|
|
30
|
-
children?: ReactNode;
|
|
31
|
-
}
|
|
32
|
-
declare function I18nProvider({ locales, locale, onLocaleChange, children, translations }: I18nProviderProps): import("react").JSX.Element;
|
|
33
|
-
//#endregion
|
|
34
|
-
export { I18nProvider, I18nProviderProps, useI18n };
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { DefaultSearchDialogProps } from "../components/dialog/search-default.js";
|
|
2
|
-
import { ComponentType, ReactNode } from "react";
|
|
3
|
-
//#region src/contexts/search.d.ts
|
|
4
|
-
interface HotKey {
|
|
5
|
-
display: ReactNode;
|
|
6
|
-
/**
|
|
7
|
-
* Key code or a function determining whether the key is pressed.
|
|
8
|
-
*/
|
|
9
|
-
key: string | ((e: KeyboardEvent) => boolean);
|
|
10
|
-
}
|
|
11
|
-
interface SharedProps {
|
|
12
|
-
open: boolean;
|
|
13
|
-
onOpenChange: (open: boolean) => void;
|
|
14
|
-
}
|
|
15
|
-
type SearchLink = [name: string, href: string];
|
|
16
|
-
interface TagItem {
|
|
17
|
-
name: string;
|
|
18
|
-
value: string;
|
|
19
|
-
}
|
|
20
|
-
interface SearchProviderProps<DialogProps extends SharedProps = DefaultSearchDialogProps> {
|
|
21
|
-
/**
|
|
22
|
-
* Preload search dialog before opening it
|
|
23
|
-
*
|
|
24
|
-
* @defaultValue `true`
|
|
25
|
-
*/
|
|
26
|
-
preload?: boolean;
|
|
27
|
-
/**
|
|
28
|
-
* Custom links to be displayed if search is empty
|
|
29
|
-
*/
|
|
30
|
-
links?: SearchLink[];
|
|
31
|
-
/**
|
|
32
|
-
* Hotkeys for triggering search dialog
|
|
33
|
-
*
|
|
34
|
-
* @defaultValue Meta/Ctrl + K
|
|
35
|
-
*/
|
|
36
|
-
hotKey?: HotKey[];
|
|
37
|
-
/**
|
|
38
|
-
* Replace default search dialog, allowing you to use other solutions such as Algolia Search
|
|
39
|
-
*
|
|
40
|
-
* It receives the `open` and `onOpenChange` prop, can be lazy loaded with `React.lazy()`
|
|
41
|
-
*/
|
|
42
|
-
SearchDialog?: ComponentType<DialogProps>;
|
|
43
|
-
/**
|
|
44
|
-
* Additional props to the dialog
|
|
45
|
-
*/
|
|
46
|
-
options?: Partial<DialogProps>;
|
|
47
|
-
children?: ReactNode;
|
|
48
|
-
}
|
|
49
|
-
interface SearchContextType {
|
|
50
|
-
enabled: boolean;
|
|
51
|
-
open: boolean;
|
|
52
|
-
hotKey: HotKey[];
|
|
53
|
-
setOpenSearch: (value: boolean) => void;
|
|
54
|
-
}
|
|
55
|
-
declare function useSearchContext(): SearchContextType;
|
|
56
|
-
declare function SearchProvider<DialogProps extends SharedProps = DefaultSearchDialogProps>({ SearchDialog, children, preload, options, hotKey, links }: SearchProviderProps<DialogProps>): import("react").JSX.Element;
|
|
57
|
-
/**
|
|
58
|
-
* Show children only when search is enabled via React Context
|
|
59
|
-
*/
|
|
60
|
-
declare function SearchOnly({ children }: {
|
|
61
|
-
children: ReactNode;
|
|
62
|
-
}): ReactNode;
|
|
63
|
-
//#endregion
|
|
64
|
-
export { SearchLink, SearchOnly, SearchProvider, SearchProviderProps, SharedProps, TagItem, useSearchContext };
|
package/dist/contexts/tree.d.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { LayoutTab } from "../layouts/shared/index.js";
|
|
2
|
-
import { ReactNode } from "react";
|
|
3
|
-
import * as PageTree from "@vx-oss/docs-core/page-tree";
|
|
4
|
-
//#region src/contexts/tree.d.ts
|
|
5
|
-
type MakeRequired<O, K extends keyof O> = Omit<O, K> & Pick<Required<O>, K>;
|
|
6
|
-
interface TreeContextType {
|
|
7
|
-
root: MakeRequired<PageTree.Root | PageTree.Folder, '$id'>;
|
|
8
|
-
full: PageTree.Root;
|
|
9
|
-
}
|
|
10
|
-
declare function TreeContextProvider({ tree: rawTree, children }: {
|
|
11
|
-
tree: PageTree.Root;
|
|
12
|
-
children: ReactNode;
|
|
13
|
-
}): import("react").JSX.Element;
|
|
14
|
-
declare function useTreePath(): PageTree.Node[];
|
|
15
|
-
declare function useTreeContext(): TreeContextType;
|
|
16
|
-
interface TabsGroup {
|
|
17
|
-
/** the root folder on the current page's path, undefined for tabs not bound to the page tree */
|
|
18
|
-
active?: PageTree.Folder;
|
|
19
|
-
options: LayoutTab[];
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Group tabs by the root folders on the current page's path (outermost first): each tab is
|
|
23
|
-
* matched to its root folder, linking to the projection of current page when possible.
|
|
24
|
-
*
|
|
25
|
-
* Tabs not bound to the page tree are appended to the group of `root: true` folders.
|
|
26
|
-
*/
|
|
27
|
-
declare function useTabsGroups(tabs: LayoutTab[]): TabsGroup[];
|
|
28
|
-
//#endregion
|
|
29
|
-
export { TabsGroup, TreeContextProvider, useTabsGroups, useTreeContext, useTreePath };
|
package/dist/i18n.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { I18nProviderProps } from "./contexts/i18n.js";
|
|
2
|
-
import { Translations } from "./.translations/index.js";
|
|
3
|
-
import { I18nConfig, SingularTranslationsAPI, TranslationExtension, TranslationsAPI } from "@vx-oss/docs-core/i18n";
|
|
4
|
-
//#region src/i18n.d.ts
|
|
5
|
-
declare function uiTranslations(): TranslationExtension<keyof Translations>;
|
|
6
|
-
declare function i18nProvider(translations: SingularTranslationsAPI): I18nProviderProps;
|
|
7
|
-
declare function i18nProvider<Languages extends string>(translations: TranslationsAPI<Languages>, lang?: NoInfer<Languages> | (string & {})): I18nProviderProps;
|
|
8
|
-
interface I18nUIConfig<Languages extends string> extends I18nConfig<Languages> {
|
|
9
|
-
provider: (locale?: Languages | (string & {})) => I18nProviderProps;
|
|
10
|
-
}
|
|
11
|
-
declare function defineI18nUI<Languages extends string>(config: I18nConfig<Languages>, localeTranslations?: Partial<Record<Languages, Record<string, string> & {
|
|
12
|
-
displayName?: string;
|
|
13
|
-
}>>): I18nUIConfig<Languages>;
|
|
14
|
-
//#endregion
|
|
15
|
-
export { I18nUIConfig, type Translations, defineI18nUI, i18nProvider, uiTranslations };
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { BaseSlots, BaseSlotsProps } from "../shared/client.js";
|
|
2
|
-
import { LayoutTab, LinkItemType } from "../shared/index.js";
|
|
3
|
-
import { SidebarProps, SidebarProviderProps } from "./slots/sidebar.js";
|
|
4
|
-
import { DocsLayoutProps } from "./index.js";
|
|
5
|
-
import { ComponentProps, FC } from "react";
|
|
6
|
-
//#region src/layouts/docs/client.d.ts
|
|
7
|
-
interface DocsSlots extends BaseSlots {
|
|
8
|
-
container: FC<ComponentProps<'div'>>;
|
|
9
|
-
header: FC<ComponentProps<'header'>>;
|
|
10
|
-
sidebar: {
|
|
11
|
-
provider: FC<SidebarProviderProps>;
|
|
12
|
-
root: FC<SidebarProps>;
|
|
13
|
-
trigger: FC<ComponentProps<'button'>>;
|
|
14
|
-
useSidebar: () => {
|
|
15
|
-
collapsed: boolean;
|
|
16
|
-
open: boolean;
|
|
17
|
-
setOpen: (v: boolean) => void;
|
|
18
|
-
};
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
interface SlotsProps extends BaseSlotsProps<DocsLayoutProps> {
|
|
22
|
-
tabs: LayoutTab[];
|
|
23
|
-
tabMode: NonNullable<DocsLayoutProps['tabMode']>;
|
|
24
|
-
}
|
|
25
|
-
declare function useDocsLayout(): {
|
|
26
|
-
props: SlotsProps;
|
|
27
|
-
isNavTransparent: boolean;
|
|
28
|
-
navItems: LinkItemType[];
|
|
29
|
-
menuItems: LinkItemType[];
|
|
30
|
-
slots: DocsSlots;
|
|
31
|
-
};
|
|
32
|
-
//#endregion
|
|
33
|
-
export { DocsSlots, useDocsLayout };
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { cn } from "../../utils/cn.js";
|
|
3
|
-
import { TreeContextProvider, useTabsGroups } from "../../contexts/tree.js";
|
|
4
|
-
import { baseSlots } from "../shared/client.js";
|
|
5
|
-
import { isLayoutTabActive, useLinkItems } from "../shared/index.js";
|
|
6
|
-
import { useIsScrollTop } from "../../utils/use-is-scroll-top.js";
|
|
7
|
-
import { Sidebar, SidebarProvider, SidebarTrigger, useSidebar } from "./slots/sidebar.js";
|
|
8
|
-
import { Header } from "./slots/header.js";
|
|
9
|
-
import { Container } from "./slots/container.js";
|
|
10
|
-
import Link from "@vx-oss/docs-core/link";
|
|
11
|
-
import { usePathname } from "@vx-oss/docs-core/framework";
|
|
12
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
13
|
-
import { createContext, use, useMemo } from "react";
|
|
14
|
-
//#region src/layouts/docs/client.tsx
|
|
15
|
-
const { useBaseSlots } = baseSlots({ useProps() {
|
|
16
|
-
return useDocsLayout().props;
|
|
17
|
-
} });
|
|
18
|
-
const LayoutContext = createContext(null);
|
|
19
|
-
function useIsDocsLayout() {
|
|
20
|
-
return use(LayoutContext) !== null;
|
|
21
|
-
}
|
|
22
|
-
function useDocsLayout() {
|
|
23
|
-
const context = use(LayoutContext);
|
|
24
|
-
if (!context) throw new Error("Please use <DocsPage /> (`@vx-oss/docs-react/layouts/docs/page`) under <DocsLayout /> (`@vx-oss/docs-react/layouts/docs`).");
|
|
25
|
-
return context;
|
|
26
|
-
}
|
|
27
|
-
function LayoutBody(props) {
|
|
28
|
-
const { nav: { enabled: navEnabled = true, transparentMode: navTransparentMode = "none" } = {}, sidebar: { enabled: sidebarEnabled = true, defaultOpenLevel, prefetch, ...sidebarProps } = {}, slots: defaultSlots, tabs, tabMode = "auto", tree, containerProps, children } = props;
|
|
29
|
-
const isTop = useIsScrollTop({ enabled: navTransparentMode === "top" }) ?? true;
|
|
30
|
-
const isNavTransparent = navTransparentMode === "top" ? isTop : navTransparentMode === "always";
|
|
31
|
-
const { baseSlots, baseProps } = useBaseSlots(props);
|
|
32
|
-
const linkItems = useLinkItems(props);
|
|
33
|
-
const slots = {
|
|
34
|
-
...baseSlots,
|
|
35
|
-
header: defaultSlots?.header ?? Header,
|
|
36
|
-
container: defaultSlots?.container ?? Container,
|
|
37
|
-
sidebar: defaultSlots?.sidebar ?? {
|
|
38
|
-
provider: SidebarProvider,
|
|
39
|
-
root: Sidebar,
|
|
40
|
-
trigger: SidebarTrigger,
|
|
41
|
-
useSidebar
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
return /* @__PURE__ */ jsx(TreeContextProvider, {
|
|
45
|
-
tree,
|
|
46
|
-
children: /* @__PURE__ */ jsx(LayoutContext, {
|
|
47
|
-
value: {
|
|
48
|
-
props: {
|
|
49
|
-
tabMode,
|
|
50
|
-
tabs,
|
|
51
|
-
...baseProps
|
|
52
|
-
},
|
|
53
|
-
isNavTransparent,
|
|
54
|
-
slots,
|
|
55
|
-
...linkItems
|
|
56
|
-
},
|
|
57
|
-
children: /* @__PURE__ */ jsx(slots.sidebar.provider, {
|
|
58
|
-
defaultOpenLevel,
|
|
59
|
-
prefetch,
|
|
60
|
-
children: /* @__PURE__ */ jsxs(slots.container, {
|
|
61
|
-
...containerProps,
|
|
62
|
-
children: [
|
|
63
|
-
navEnabled && /* @__PURE__ */ jsx(slots.header, {}),
|
|
64
|
-
sidebarEnabled && /* @__PURE__ */ jsx(slots.sidebar.root, { ...sidebarProps }),
|
|
65
|
-
tabMode === "top" && tabs.length > 0 && /* @__PURE__ */ jsx(LayoutTabs, {
|
|
66
|
-
tabs,
|
|
67
|
-
className: "z-10 bg-fd-background border-b px-6 pt-3 xl:px-8 max-md:hidden"
|
|
68
|
-
}),
|
|
69
|
-
children
|
|
70
|
-
]
|
|
71
|
-
})
|
|
72
|
-
})
|
|
73
|
-
})
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
function LayoutTabs({ tabs: allTabs, ...props }) {
|
|
77
|
-
const pathname = usePathname();
|
|
78
|
-
const group = useTabsGroups(allTabs).findLast((group) => typeof group.active?.root !== "string");
|
|
79
|
-
const selected = useMemo(() => {
|
|
80
|
-
return group?.options.findLast((option) => isLayoutTabActive(option, pathname));
|
|
81
|
-
}, [group, pathname]);
|
|
82
|
-
if (!group) return;
|
|
83
|
-
return /* @__PURE__ */ jsx("div", {
|
|
84
|
-
...props,
|
|
85
|
-
className: cn("flex flex-row items-end gap-6 overflow-auto [grid-area:main]", props.className),
|
|
86
|
-
children: group.options.map((tab, i) => /* @__PURE__ */ jsx(Link, {
|
|
87
|
-
href: tab.url,
|
|
88
|
-
className: cn("inline-flex border-b-2 border-transparent transition-colors items-center pb-1.5 font-medium gap-2 text-fd-muted-foreground text-sm text-nowrap hover:text-fd-accent-foreground", tab.unlisted && selected !== tab && "hidden", selected === tab && "border-fd-primary text-fd-primary"),
|
|
89
|
-
children: tab.title
|
|
90
|
-
}, i))
|
|
91
|
-
});
|
|
92
|
-
}
|
|
93
|
-
//#endregion
|
|
94
|
-
export { LayoutBody, useDocsLayout, useIsDocsLayout };
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { BaseLayoutProps, GetLayoutTabsOptions, LayoutTab } from "../shared/index.js";
|
|
2
|
-
import { SidebarProps, SidebarProviderProps } from "./slots/sidebar.js";
|
|
3
|
-
import { DocsSlots, useDocsLayout } from "./client.js";
|
|
4
|
-
import { HTMLAttributes, ReactNode } from "react";
|
|
5
|
-
import * as PageTree from "@vx-oss/docs-core/page-tree";
|
|
6
|
-
//#region src/layouts/docs/index.d.ts
|
|
7
|
-
interface DocsLayoutProps extends BaseLayoutProps {
|
|
8
|
-
tree: PageTree.Root;
|
|
9
|
-
sidebar?: SidebarOptions;
|
|
10
|
-
tabMode?: 'top' | 'auto';
|
|
11
|
-
tabs?: LayoutTab[] | GetLayoutTabsOptions | false;
|
|
12
|
-
containerProps?: HTMLAttributes<HTMLDivElement>;
|
|
13
|
-
slots?: Partial<DocsSlots>;
|
|
14
|
-
}
|
|
15
|
-
interface SidebarOptions extends SidebarProps, SidebarProviderProps {
|
|
16
|
-
enabled?: boolean;
|
|
17
|
-
/**
|
|
18
|
-
* @deprecated use `slots.sidebar` instead.
|
|
19
|
-
*/
|
|
20
|
-
component?: ReactNode;
|
|
21
|
-
/**
|
|
22
|
-
* @deprecated use layout-level `tabMode` option instead.
|
|
23
|
-
*/
|
|
24
|
-
tabMode?: 'auto' | 'top';
|
|
25
|
-
/**
|
|
26
|
-
* @deprecated use layout-level `tabs` option instead.
|
|
27
|
-
*/
|
|
28
|
-
tabs?: LayoutTab[] | GetLayoutTabsOptions | false;
|
|
29
|
-
}
|
|
30
|
-
declare function DocsLayout({ tree, sidebar: { tabs: _tabs, tabMode: _tabMode, ...sidebarProps }, tabs: layoutTabs, tabMode, children, ...props }: DocsLayoutProps): import("react").JSX.Element;
|
|
31
|
-
//#endregion
|
|
32
|
-
export { DocsLayout, DocsLayoutProps, type DocsSlots, useDocsLayout };
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import { TOCPopoverProps, TOCProps, TOCProviderProps } from "./slots/toc.js";
|
|
2
|
-
import { Footer, FooterProps } from "./slots/footer.js";
|
|
3
|
-
import { Breadcrumb, BreadcrumbProps } from "./slots/breadcrumb.js";
|
|
4
|
-
import { MarkdownCopyButton, ViewOptionsPopover } from "../../shared/page-actions.js";
|
|
5
|
-
import { ComponentProps, FC, ReactNode } from "react";
|
|
6
|
-
import { TOCItemType } from "@vx-oss/docs-core/toc";
|
|
7
|
-
//#region src/layouts/docs/page/index.d.ts
|
|
8
|
-
interface DocsPageProps extends ComponentProps<'article'> {
|
|
9
|
-
toc?: TOCItemType[];
|
|
10
|
-
/**
|
|
11
|
-
* Extend the page to fill all available space
|
|
12
|
-
*
|
|
13
|
-
* @defaultValue false
|
|
14
|
-
*/
|
|
15
|
-
full?: boolean | undefined;
|
|
16
|
-
slots?: Partial<DocsPageSlots>;
|
|
17
|
-
footer?: FooterOptions;
|
|
18
|
-
breadcrumb?: BreadcrumbOptions;
|
|
19
|
-
tableOfContent?: TableOfContentOptions;
|
|
20
|
-
tableOfContentPopover?: TableOfContentPopoverOptions;
|
|
21
|
-
}
|
|
22
|
-
interface BreadcrumbOptions extends BreadcrumbProps {
|
|
23
|
-
enabled?: boolean;
|
|
24
|
-
/**
|
|
25
|
-
* @deprecated use `slots.breadcrumb` instead.
|
|
26
|
-
*/
|
|
27
|
-
component?: ReactNode;
|
|
28
|
-
}
|
|
29
|
-
interface FooterOptions extends FooterProps {
|
|
30
|
-
enabled?: boolean;
|
|
31
|
-
/**
|
|
32
|
-
* @deprecated use `slots.footer` instead.
|
|
33
|
-
*/
|
|
34
|
-
component?: ReactNode;
|
|
35
|
-
}
|
|
36
|
-
type TableOfContentOptions = Pick<TOCProviderProps, 'single'> & TOCProps & {
|
|
37
|
-
enabled?: boolean;
|
|
38
|
-
/**
|
|
39
|
-
* @deprecated use `slots.toc` instead.
|
|
40
|
-
*/
|
|
41
|
-
component?: ReactNode;
|
|
42
|
-
};
|
|
43
|
-
type TableOfContentPopoverOptions = TOCPopoverProps & {
|
|
44
|
-
enabled?: boolean;
|
|
45
|
-
/**
|
|
46
|
-
* @deprecated use `slots.tocPopover` instead.
|
|
47
|
-
*/
|
|
48
|
-
component?: ReactNode;
|
|
49
|
-
};
|
|
50
|
-
interface DocsPageSlots {
|
|
51
|
-
toc: {
|
|
52
|
-
provider: FC<TOCProviderProps>;
|
|
53
|
-
main: FC<TOCProps>;
|
|
54
|
-
popover: FC<TOCPopoverProps>;
|
|
55
|
-
};
|
|
56
|
-
container: FC<ComponentProps<'article'>>;
|
|
57
|
-
footer: FC<FooterProps>;
|
|
58
|
-
breadcrumb: FC<BreadcrumbProps>;
|
|
59
|
-
}
|
|
60
|
-
declare function useDocsPage(): {
|
|
61
|
-
full: NonNullable<DocsPageProps["full"]>;
|
|
62
|
-
slots: DocsPageSlots;
|
|
63
|
-
};
|
|
64
|
-
declare function DocsPage({ full, tableOfContent: { enabled: tocEnabled, single, ...tocProps }, tableOfContentPopover: { enabled: tocPopoverEnabled, ...tocPopoverProps }, breadcrumb: { enabled: breadcrumbEnabled, ...breadcrumb }, footer: { enabled: footerEnabled, ...footer }, toc, slots: defaultSlots, children, ...containerProps }: DocsPageProps): import("react").JSX.Element;
|
|
65
|
-
declare function EditOnGitHub(props: ComponentProps<'a'>): import("react").JSX.Element;
|
|
66
|
-
/**
|
|
67
|
-
* Add typography styles
|
|
68
|
-
*/
|
|
69
|
-
declare function DocsBody({ children, className, ...props }: ComponentProps<'div'>): import("react").JSX.Element;
|
|
70
|
-
declare function DocsDescription({ children, className, ...props }: ComponentProps<'p'>): import("react").JSX.Element | null;
|
|
71
|
-
declare function DocsTitle({ children, className, ...props }: ComponentProps<'h1'>): import("react").JSX.Element;
|
|
72
|
-
declare function PageLastUpdate({ date: value, ...props }: Omit<ComponentProps<'p'>, 'children'> & {
|
|
73
|
-
date: Date;
|
|
74
|
-
}): import("react").JSX.Element;
|
|
75
|
-
//#endregion
|
|
76
|
-
export { type BreadcrumbProps, DocsBody, DocsDescription, DocsPage, DocsPageProps, DocsTitle, EditOnGitHub, type FooterProps, MarkdownCopyButton, Breadcrumb as PageBreadcrumb, Footer as PageFooter, PageLastUpdate, ViewOptionsPopover, useDocsPage };
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { ComponentProps } from "react";
|
|
2
|
-
import { BreadcrumbOptions } from "@vx-oss/docs-core/breadcrumb";
|
|
3
|
-
//#region src/layouts/docs/page/slots/breadcrumb.d.ts
|
|
4
|
-
type BreadcrumbProps = BreadcrumbOptions & ComponentProps<'div'>;
|
|
5
|
-
declare function Breadcrumb({ includeRoot, includeSeparator, includePage, ...props }: BreadcrumbProps): import("react").JSX.Element | null;
|
|
6
|
-
//#endregion
|
|
7
|
-
export { Breadcrumb, BreadcrumbProps };
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { ComponentProps } from "react";
|
|
2
|
-
import * as PageTree from "@vx-oss/docs-core/page-tree";
|
|
3
|
-
//#region src/layouts/docs/page/slots/footer.d.ts
|
|
4
|
-
type Item = Pick<PageTree.Item, 'name' | 'description' | 'url'>;
|
|
5
|
-
interface FooterProps extends ComponentProps<'div'> {
|
|
6
|
-
/**
|
|
7
|
-
* Items including information for the next and previous page
|
|
8
|
-
*/
|
|
9
|
-
items?: {
|
|
10
|
-
previous?: Item;
|
|
11
|
-
next?: Item;
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
declare function Footer({ items, children, className, ...props }: FooterProps): import("react").JSX.Element;
|
|
15
|
-
//#endregion
|
|
16
|
-
export { Footer, FooterProps };
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { TOCItemsProps } from "../../../../components/toc/clerk.js";
|
|
2
|
-
import { TOCItemsProps as TOCItemsProps$1 } from "../../../../components/toc/default.js";
|
|
3
|
-
import { TOCProviderProps as TOCProviderProps$1 } from "../../../../components/toc/index.js";
|
|
4
|
-
import { ComponentProps, ReactNode } from "react";
|
|
5
|
-
//#region src/layouts/docs/page/slots/toc.d.ts
|
|
6
|
-
type TOCProviderProps = TOCProviderProps$1;
|
|
7
|
-
declare function TOCProvider(props: TOCProviderProps): import("react").JSX.Element;
|
|
8
|
-
type TOCProps = {
|
|
9
|
-
container?: ComponentProps<'div'>;
|
|
10
|
-
/**
|
|
11
|
-
* Custom content in TOC container, before the main TOC
|
|
12
|
-
*/
|
|
13
|
-
header?: ReactNode;
|
|
14
|
-
/**
|
|
15
|
-
* Custom content in TOC container, after the main TOC
|
|
16
|
-
*/
|
|
17
|
-
footer?: ReactNode;
|
|
18
|
-
} & ({
|
|
19
|
-
style?: 'normal';
|
|
20
|
-
list?: TOCItemsProps$1;
|
|
21
|
-
} | {
|
|
22
|
-
style: 'clerk';
|
|
23
|
-
list?: TOCItemsProps;
|
|
24
|
-
});
|
|
25
|
-
declare function TOC({ container, header, footer, style, list }: TOCProps): import("react").JSX.Element;
|
|
26
|
-
type TOCPopoverProps = {
|
|
27
|
-
container?: ComponentProps<'div'>;
|
|
28
|
-
trigger?: ComponentProps<'button'>;
|
|
29
|
-
content?: ComponentProps<'div'>;
|
|
30
|
-
/**
|
|
31
|
-
* Custom content in TOC container, before the main TOC
|
|
32
|
-
*/
|
|
33
|
-
header?: ReactNode;
|
|
34
|
-
/**
|
|
35
|
-
* Custom content in TOC container, after the main TOC
|
|
36
|
-
*/
|
|
37
|
-
footer?: ReactNode;
|
|
38
|
-
} & ({
|
|
39
|
-
style?: 'normal';
|
|
40
|
-
list?: TOCItemsProps$1;
|
|
41
|
-
} | {
|
|
42
|
-
style: 'clerk';
|
|
43
|
-
list?: TOCItemsProps;
|
|
44
|
-
});
|
|
45
|
-
declare function TOCPopover({ container, trigger, content, header, footer, style, list }: TOCPopoverProps): import("react").JSX.Element;
|
|
46
|
-
//#endregion
|
|
47
|
-
export { TOC, TOCPopover, TOCPopoverProps, TOCProps, TOCProvider, TOCProviderProps };
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { ComponentProps } from "react";
|
|
2
|
-
//#region src/layouts/docs/slots/header.d.ts
|
|
3
|
-
declare function Header(props: ComponentProps<'header'>): string | number | bigint | true | import("react").JSX.Element | Iterable<import("react").ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<import("react").ReactNode> | null | undefined>;
|
|
4
|
-
//#endregion
|
|
5
|
-
export { Header };
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { SidebarProviderProps as SidebarProviderProps$1, useSidebar as useSidebar$1 } from "../../../components/sidebar/base.js";
|
|
2
|
-
import { SidebarPageTreeComponents } from "../../../components/sidebar/page-tree.js";
|
|
3
|
-
import { ComponentProps, ReactNode } from "react";
|
|
4
|
-
//#region src/layouts/docs/slots/sidebar.d.ts
|
|
5
|
-
interface SidebarProps extends ComponentProps<'aside'> {
|
|
6
|
-
components?: Partial<SidebarPageTreeComponents>;
|
|
7
|
-
banner?: ReactNode;
|
|
8
|
-
footer?: ReactNode;
|
|
9
|
-
/**
|
|
10
|
-
* Support collapsing the sidebar on desktop mode
|
|
11
|
-
*
|
|
12
|
-
* @defaultValue true
|
|
13
|
-
*/
|
|
14
|
-
collapsible?: boolean;
|
|
15
|
-
}
|
|
16
|
-
type SidebarProviderProps = SidebarProviderProps$1;
|
|
17
|
-
declare const useSidebar: typeof useSidebar$1;
|
|
18
|
-
declare function SidebarProvider(props: SidebarProviderProps): import("react").JSX.Element;
|
|
19
|
-
declare function Sidebar({ footer, banner, collapsible, components, ...rest }: SidebarProps): import("react").JSX.Element;
|
|
20
|
-
declare function SidebarTrigger(props: ComponentProps<'button'>): import("react").JSX.Element;
|
|
21
|
-
//#endregion
|
|
22
|
-
export { Sidebar, SidebarProps, SidebarProvider, SidebarProviderProps, SidebarTrigger, useSidebar };
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { BaseSlots, BaseSlotsProps } from "../shared/client.js";
|
|
2
|
-
import { BaseLayoutProps, GetLayoutTabsOptions, LayoutTab, LinkItemType } from "../shared/index.js";
|
|
3
|
-
import { TabDropdownProps } from "./slots/tab-dropdown.js";
|
|
4
|
-
import { SidebarProps, SidebarProviderProps } from "./slots/sidebar.js";
|
|
5
|
-
import { ComponentProps, FC, ReactNode } from "react";
|
|
6
|
-
import * as PageTree from "@vx-oss/docs-core/page-tree";
|
|
7
|
-
import { motion } from "motion/react";
|
|
8
|
-
//#region src/layouts/flux/index.d.ts
|
|
9
|
-
interface DocsSlots extends BaseSlots {
|
|
10
|
-
container: FC<ComponentProps<'div'>>;
|
|
11
|
-
tabDropdown: FC<TabDropdownProps>;
|
|
12
|
-
sidebar: {
|
|
13
|
-
provider: FC<SidebarProviderProps>;
|
|
14
|
-
trigger: FC<ComponentProps<'button'>>;
|
|
15
|
-
root: FC<SidebarProps>;
|
|
16
|
-
useSidebar: () => {
|
|
17
|
-
collapsed: boolean;
|
|
18
|
-
open: boolean;
|
|
19
|
-
setOpen: (v: boolean) => void;
|
|
20
|
-
};
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
interface DocsLayoutProps extends BaseLayoutProps {
|
|
24
|
-
tree: PageTree.Root;
|
|
25
|
-
sidebar?: SidebarOptions;
|
|
26
|
-
tabs?: LayoutTab[] | GetLayoutTabsOptions | false;
|
|
27
|
-
slots?: Partial<DocsSlots>;
|
|
28
|
-
renderNavigationPanel?: (props: NavigationPanelProps) => ReactNode;
|
|
29
|
-
containerProps?: ComponentProps<'div'>;
|
|
30
|
-
}
|
|
31
|
-
interface SidebarOptions extends SidebarProps, SidebarProviderProps {
|
|
32
|
-
enabled?: boolean;
|
|
33
|
-
/**
|
|
34
|
-
* @deprecated use layout-level `tabs` instead.
|
|
35
|
-
*/
|
|
36
|
-
tabs?: LayoutTab[] | GetLayoutTabsOptions | false;
|
|
37
|
-
}
|
|
38
|
-
declare function useFluxLayout(): {
|
|
39
|
-
props: BaseSlotsProps;
|
|
40
|
-
menuItems: LinkItemType[];
|
|
41
|
-
navItems: LinkItemType[];
|
|
42
|
-
slots: DocsSlots;
|
|
43
|
-
};
|
|
44
|
-
declare function DocsLayout(props: DocsLayoutProps): import("react").JSX.Element;
|
|
45
|
-
interface NavigationPanelProps {
|
|
46
|
-
head: ReactNode;
|
|
47
|
-
tabDropdown: ReactNode;
|
|
48
|
-
tool: ReactNode;
|
|
49
|
-
link: ReactNode;
|
|
50
|
-
}
|
|
51
|
-
declare function NavigationPanel({ head, tabDropdown, tool, link, children, ...props }: NavigationPanelProps & Omit<ComponentProps<typeof motion.div>, 'children'> & {
|
|
52
|
-
/**
|
|
53
|
-
* replace default children
|
|
54
|
-
*/
|
|
55
|
-
children?: (defaultChildren: ReactNode) => ReactNode;
|
|
56
|
-
}): import("react").JSX.Element;
|
|
57
|
-
declare function NavigationPanelOverlay({ enabled, className, ...props }: ComponentProps<typeof motion.div> & {
|
|
58
|
-
enabled?: boolean;
|
|
59
|
-
}): import("react").JSX.Element;
|
|
60
|
-
//#endregion
|
|
61
|
-
export { DocsLayout, DocsLayoutProps, DocsSlots, NavigationPanel, NavigationPanelOverlay, NavigationPanelProps, useFluxLayout };
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { MarkdownCopyButton, ViewOptionsPopover } from "../../shared/page-actions.js";
|
|
2
|
-
import { TOCProps, TOCProviderProps } from "./slots/toc.js";
|
|
3
|
-
import { Footer, FooterProps } from "./slots/footer.js";
|
|
4
|
-
import { Breadcrumb, BreadcrumbProps } from "./slots/breadcrumb.js";
|
|
5
|
-
import { ComponentProps, FC, ReactNode } from "react";
|
|
6
|
-
import { TOCItemType } from "@vx-oss/docs-core/toc";
|
|
7
|
-
//#region src/layouts/flux/page/index.d.ts
|
|
8
|
-
interface DocsPageProps extends ComponentProps<'article'> {
|
|
9
|
-
toc?: TOCItemType[];
|
|
10
|
-
/**
|
|
11
|
-
* Extend the page to fill all available space
|
|
12
|
-
*
|
|
13
|
-
* @defaultValue false
|
|
14
|
-
*/
|
|
15
|
-
full?: boolean | undefined;
|
|
16
|
-
slots?: Partial<DocsPageSlots>;
|
|
17
|
-
footer?: FooterOptions;
|
|
18
|
-
breadcrumb?: BreadcrumbOptions;
|
|
19
|
-
tableOfContent?: TableOfContentOptions;
|
|
20
|
-
}
|
|
21
|
-
type TableOfContentOptions = Pick<TOCProviderProps, 'single'> & TOCProps & {
|
|
22
|
-
enabled?: boolean;
|
|
23
|
-
/**
|
|
24
|
-
* @deprecated use `slots.toc` instead.
|
|
25
|
-
*/
|
|
26
|
-
component?: ReactNode;
|
|
27
|
-
};
|
|
28
|
-
interface BreadcrumbOptions extends BreadcrumbProps {
|
|
29
|
-
enabled?: boolean;
|
|
30
|
-
/**
|
|
31
|
-
* @deprecated use `slots.breadcrumb` instead.
|
|
32
|
-
*/
|
|
33
|
-
component?: ReactNode;
|
|
34
|
-
}
|
|
35
|
-
interface FooterOptions extends FooterProps {
|
|
36
|
-
enabled?: boolean;
|
|
37
|
-
/**
|
|
38
|
-
* @deprecated use `slots.footer` instead.
|
|
39
|
-
*/
|
|
40
|
-
component?: ReactNode;
|
|
41
|
-
}
|
|
42
|
-
interface DocsPageSlots {
|
|
43
|
-
toc: {
|
|
44
|
-
provider: FC<TOCProviderProps>;
|
|
45
|
-
main: FC<TOCProps>;
|
|
46
|
-
};
|
|
47
|
-
container: FC<ComponentProps<'article'>>;
|
|
48
|
-
footer: FC<FooterProps>;
|
|
49
|
-
breadcrumb: FC<BreadcrumbProps>;
|
|
50
|
-
}
|
|
51
|
-
declare function useDocsPage(): {
|
|
52
|
-
full: NonNullable<DocsPageProps["full"]>;
|
|
53
|
-
slots: DocsPageSlots;
|
|
54
|
-
};
|
|
55
|
-
declare function DocsPage({ full, tableOfContent: { enabled: tocEnabled, single, ...tocProps }, breadcrumb: { enabled: breadcrumbEnabled, ...breadcrumb }, footer: { enabled: footerEnabled, ...footer }, toc, slots: defaultSlots, children, ...containerProps }: DocsPageProps): import("react").JSX.Element;
|
|
56
|
-
declare function EditOnGitHub(props: ComponentProps<'a'>): import("react").JSX.Element;
|
|
57
|
-
/**
|
|
58
|
-
* Add typography styles
|
|
59
|
-
*/
|
|
60
|
-
declare function DocsBody({ children, className, ...props }: ComponentProps<'div'>): import("react").JSX.Element;
|
|
61
|
-
declare function DocsDescription({ children, className, ...props }: ComponentProps<'p'>): import("react").JSX.Element | null;
|
|
62
|
-
declare function DocsTitle({ children, className, ...props }: ComponentProps<'h1'>): import("react").JSX.Element;
|
|
63
|
-
declare function PageLastUpdate({ date: value, ...props }: Omit<ComponentProps<'p'>, 'children'> & {
|
|
64
|
-
date: Date;
|
|
65
|
-
}): import("react").JSX.Element;
|
|
66
|
-
//#endregion
|
|
67
|
-
export { type BreadcrumbProps, DocsBody, DocsDescription, DocsPage, DocsPageProps, DocsTitle, EditOnGitHub, type FooterProps, MarkdownCopyButton, Breadcrumb as PageBreadcrumb, Footer as PageFooter, PageLastUpdate, ViewOptionsPopover, useDocsPage };
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { ComponentProps } from "react";
|
|
2
|
-
import { BreadcrumbOptions } from "@vx-oss/docs-core/breadcrumb";
|
|
3
|
-
//#region src/layouts/flux/page/slots/breadcrumb.d.ts
|
|
4
|
-
type BreadcrumbProps = BreadcrumbOptions & ComponentProps<'div'>;
|
|
5
|
-
declare function Breadcrumb({ includeRoot, includeSeparator, includePage, ...props }: BreadcrumbProps): import("react").JSX.Element | null;
|
|
6
|
-
//#endregion
|
|
7
|
-
export { Breadcrumb, BreadcrumbProps };
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { ComponentProps } from "react";
|
|
2
|
-
import * as PageTree from "@vx-oss/docs-core/page-tree";
|
|
3
|
-
//#region src/layouts/flux/page/slots/footer.d.ts
|
|
4
|
-
type Item = Pick<PageTree.Item, 'name' | 'description' | 'url'>;
|
|
5
|
-
interface FooterProps extends ComponentProps<'div'> {
|
|
6
|
-
/**
|
|
7
|
-
* Items including information for the next and previous page
|
|
8
|
-
*/
|
|
9
|
-
items?: {
|
|
10
|
-
previous?: Item;
|
|
11
|
-
next?: Item;
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
declare function Footer({ items, children, className, ...props }: FooterProps): import("react").JSX.Element;
|
|
15
|
-
//#endregion
|
|
16
|
-
export { Footer, FooterProps };
|