mdx-forge 0.1.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.
- package/LICENSE +21 -0
- package/README.md +64 -0
- package/dist/components/base/styles/callout.css +64 -0
- package/dist/components/base/styles/collapsible.css +96 -0
- package/dist/components/base/styles/index.css +7 -0
- package/dist/components/base/styles/tabs.css +97 -0
- package/dist/components/docusaurus/styles.css +291 -0
- package/dist/components/generic/styles.css +102 -0
- package/dist/components/nextra/styles.css +500 -0
- package/dist/components/shared/callout-variants.css +81 -0
- package/dist/components/shared/index.css +6 -0
- package/dist/components/shared/tokens.css +105 -0
- package/dist/components/starlight/styles.css +602 -0
- package/dist/components/styles/docusaurus.css +2 -0
- package/dist/components/styles/generic.css +2 -0
- package/dist/components/styles/nextjs.css +1 -0
- package/dist/components/styles/nextra.css +2 -0
- package/dist/components/styles/starlight.css +2 -0
- package/dist/components/styles/tokens.css +1 -0
- package/dist/esm/browser/errors.js +48 -0
- package/dist/esm/browser/eval/evaluateModule.js +49 -0
- package/dist/esm/browser/index.js +147 -0
- package/dist/esm/browser/internal/constants.js +4 -0
- package/dist/esm/browser/internal/logger.js +9 -0
- package/dist/esm/browser/internal/lru-cache.js +139 -0
- package/dist/esm/browser/internal/module-id.js +7 -0
- package/dist/esm/browser/internal/runtime-config.js +35 -0
- package/dist/esm/browser/internal/semaphore.js +23 -0
- package/dist/esm/browser/internal/style-injector.js +32 -0
- package/dist/esm/browser/loader/circular.js +15 -0
- package/dist/esm/browser/loader/loadModule.js +175 -0
- package/dist/esm/browser/preload/core.js +16 -0
- package/dist/esm/browser/preload/index.js +77 -0
- package/dist/esm/browser/preload/shimLoader.js +88 -0
- package/dist/esm/browser/registry/DependencyTracker.js +154 -0
- package/dist/esm/browser/registry/ModuleCache.js +168 -0
- package/dist/esm/browser/registry/ModuleRegistry.js +156 -0
- package/dist/esm/browser/registry/StyleCache.js +94 -0
- package/dist/esm/browser/registry/index.js +4 -0
- package/dist/esm/browser/runtime/require.js +40 -0
- package/dist/esm/browser/styles/injectStyles.js +42 -0
- package/dist/esm/browser/types.js +8 -0
- package/dist/esm/compiler/index.js +9 -0
- package/dist/esm/compiler/internal/components.js +28 -0
- package/dist/esm/compiler/internal/logging.js +10 -0
- package/dist/esm/compiler/internal/path.js +17 -0
- package/dist/esm/compiler/internal/plugin-loader.js +23 -0
- package/dist/esm/compiler/internal/trust.js +16 -0
- package/dist/esm/compiler/pipeline/common/icon-registry.js +1 -0
- package/dist/esm/compiler/pipeline/common/mdx-common.js +61 -0
- package/dist/esm/compiler/pipeline/common/pipeline-config.js +163 -0
- package/dist/esm/compiler/pipeline/common/pipeline-warnings.js +125 -0
- package/dist/esm/compiler/pipeline/rehype/create-diagram-placeholder.js +79 -0
- package/dist/esm/compiler/pipeline/rehype/graphviz-placeholder.js +15 -0
- package/dist/esm/compiler/pipeline/rehype/lazy-images.js +19 -0
- package/dist/esm/compiler/pipeline/rehype/mermaid-placeholder.js +11 -0
- package/dist/esm/compiler/pipeline/rehype/plantuml-placeholder.js +11 -0
- package/dist/esm/compiler/pipeline/rehype/rehype-raw.js +33 -0
- package/dist/esm/compiler/pipeline/rehype/shiki-helpers.js +9 -0
- package/dist/esm/compiler/pipeline/rehype/shiki.js +318 -0
- package/dist/esm/compiler/pipeline/remark/admonitions.js +168 -0
- package/dist/esm/compiler/pipeline/remark/generic-components.js +56 -0
- package/dist/esm/compiler/pipeline/remark/github-alerts.js +121 -0
- package/dist/esm/compiler/pipeline/transforms/callout.js +78 -0
- package/dist/esm/compiler/pipeline/transforms/code-group.js +23 -0
- package/dist/esm/compiler/pipeline/transforms/collapsible.js +30 -0
- package/dist/esm/compiler/pipeline/transforms/index.js +12 -0
- package/dist/esm/compiler/pipeline/transforms/tabs.js +48 -0
- package/dist/esm/compiler/pipeline/transforms/utils.js +69 -0
- package/dist/esm/compiler/plugins/builder.js +54 -0
- package/dist/esm/compiler/plugins/index.js +3 -0
- package/dist/esm/compiler/plugins/loader.js +120 -0
- package/dist/esm/compiler/plugins/shared-plugins.js +56 -0
- package/dist/esm/compiler/plugins/utils.js +13 -0
- package/dist/esm/compiler/safe/compile.js +228 -0
- package/dist/esm/compiler/transforms/index.js +1 -0
- package/dist/esm/compiler/trusted/compile.js +134 -0
- package/dist/esm/compiler/trusted/component-mapper.js +85 -0
- package/dist/esm/compiler/trusted/hasDefaultExport.js +15 -0
- package/dist/esm/compiler/types/compiler.js +1 -0
- package/dist/esm/compiler/types/index.js +3 -0
- package/dist/esm/compiler/types/mdx.js +3 -0
- package/dist/esm/compiler/types/pipeline.js +18 -0
- package/dist/esm/components/base/BaseCallout.js +50 -0
- package/dist/esm/components/base/BaseCard.js +11 -0
- package/dist/esm/components/base/BaseCodeBlock.js +42 -0
- package/dist/esm/components/base/BaseTabs.js +168 -0
- package/dist/esm/components/base/CopyButton.js +12 -0
- package/dist/esm/components/base/createCollapsible.js +63 -0
- package/dist/esm/components/base/createIconComponent.js +31 -0
- package/dist/esm/components/base/extractTextContent.js +19 -0
- package/dist/esm/components/base/icons.js +49 -0
- package/dist/esm/components/base/index.js +15 -0
- package/dist/esm/components/base/useCopyToClipboard.js +17 -0
- package/dist/esm/components/base/useTabState.js +113 -0
- package/dist/esm/components/docusaurus/CodeBlock.js +13 -0
- package/dist/esm/components/docusaurus/Details.js +18 -0
- package/dist/esm/components/docusaurus/Tabs.js +15 -0
- package/dist/esm/components/docusaurus/index.js +3 -0
- package/dist/esm/components/generic/Callout.js +28 -0
- package/dist/esm/components/generic/CodeGroup.js +52 -0
- package/dist/esm/components/generic/Collapsible.js +21 -0
- package/dist/esm/components/generic/TabItem.js +8 -0
- package/dist/esm/components/generic/Tabs.js +13 -0
- package/dist/esm/components/generic/index.js +6 -0
- package/dist/esm/components/generic/types.js +5 -0
- package/dist/esm/components/index.js +8 -0
- package/dist/esm/components/internal/clipboard.js +9 -0
- package/dist/esm/components/internal/cn.js +4 -0
- package/dist/esm/components/internal/constants.js +1 -0
- package/dist/esm/components/nextjs/Image.js +36 -0
- package/dist/esm/components/nextjs/Link.js +28 -0
- package/dist/esm/components/nextjs/index.js +2 -0
- package/dist/esm/components/nextra/Bleed.js +18 -0
- package/dist/esm/components/nextra/Callout.js +30 -0
- package/dist/esm/components/nextra/Cards.js +25 -0
- package/dist/esm/components/nextra/FileTree.js +11 -0
- package/dist/esm/components/nextra/Steps.js +11 -0
- package/dist/esm/components/nextra/Tabs.js +28 -0
- package/dist/esm/components/nextra/createNextraWrapper.js +12 -0
- package/dist/esm/components/nextra/index.js +6 -0
- package/dist/esm/components/registry/index.js +4 -0
- package/dist/esm/components/registry/queries.js +69 -0
- package/dist/esm/components/registry/registry-data.js +357 -0
- package/dist/esm/components/registry/shim-config.js +187 -0
- package/dist/esm/components/registry/types.js +3 -0
- package/dist/esm/components/starlight/Aside.js +24 -0
- package/dist/esm/components/starlight/Badge.js +6 -0
- package/dist/esm/components/starlight/Card.js +28 -0
- package/dist/esm/components/starlight/CardGrid.js +6 -0
- package/dist/esm/components/starlight/Code.js +25 -0
- package/dist/esm/components/starlight/FileTree.js +148 -0
- package/dist/esm/components/starlight/LinkCard.js +8 -0
- package/dist/esm/components/starlight/Steps.js +6 -0
- package/dist/esm/components/starlight/Tabs.js +6 -0
- package/dist/esm/components/starlight/index.js +9 -0
- package/dist/esm/internal/callout.js +43 -0
- package/dist/esm/internal/errors.js +27 -0
- package/dist/esm/internal/icons.js +41 -0
- package/dist/types/browser/errors.d.ts +18 -0
- package/dist/types/browser/eval/evaluateModule.d.ts +2 -0
- package/dist/types/browser/index.d.ts +20 -0
- package/dist/types/browser/internal/constants.d.ts +4 -0
- package/dist/types/browser/internal/logger.d.ts +9 -0
- package/dist/types/browser/internal/lru-cache.d.ts +33 -0
- package/dist/types/browser/internal/module-id.d.ts +1 -0
- package/dist/types/browser/internal/runtime-config.d.ts +10 -0
- package/dist/types/browser/internal/semaphore.d.ts +7 -0
- package/dist/types/browser/internal/style-injector.d.ts +3 -0
- package/dist/types/browser/loader/circular.d.ts +4 -0
- package/dist/types/browser/loader/loadModule.d.ts +2 -0
- package/dist/types/browser/preload/core.d.ts +11 -0
- package/dist/types/browser/preload/index.d.ts +21 -0
- package/dist/types/browser/preload/shimLoader.d.ts +20 -0
- package/dist/types/browser/registry/DependencyTracker.d.ts +23 -0
- package/dist/types/browser/registry/ModuleCache.d.ts +30 -0
- package/dist/types/browser/registry/ModuleRegistry.d.ts +44 -0
- package/dist/types/browser/registry/StyleCache.d.ts +17 -0
- package/dist/types/browser/registry/index.d.ts +4 -0
- package/dist/types/browser/runtime/require.d.ts +1 -0
- package/dist/types/browser/styles/injectStyles.d.ts +3 -0
- package/dist/types/browser/types.d.ts +50 -0
- package/dist/types/compiler/index.d.ts +6 -0
- package/dist/types/compiler/internal/components.d.ts +21 -0
- package/dist/types/compiler/internal/logging.d.ts +3 -0
- package/dist/types/compiler/internal/path.d.ts +2 -0
- package/dist/types/compiler/internal/plugin-loader.d.ts +2 -0
- package/dist/types/compiler/internal/trust.d.ts +2 -0
- package/dist/types/compiler/pipeline/common/icon-registry.d.ts +1 -0
- package/dist/types/compiler/pipeline/common/mdx-common.d.ts +8 -0
- package/dist/types/compiler/pipeline/common/pipeline-config.d.ts +39 -0
- package/dist/types/compiler/pipeline/common/pipeline-warnings.d.ts +21 -0
- package/dist/types/compiler/pipeline/rehype/create-diagram-placeholder.d.ts +15 -0
- package/dist/types/compiler/pipeline/rehype/graphviz-placeholder.d.ts +2 -0
- package/dist/types/compiler/pipeline/rehype/lazy-images.d.ts +2 -0
- package/dist/types/compiler/pipeline/rehype/mermaid-placeholder.d.ts +2 -0
- package/dist/types/compiler/pipeline/rehype/plantuml-placeholder.d.ts +2 -0
- package/dist/types/compiler/pipeline/rehype/rehype-raw.d.ts +2 -0
- package/dist/types/compiler/pipeline/rehype/shiki-helpers.d.ts +2 -0
- package/dist/types/compiler/pipeline/rehype/shiki.d.ts +2 -0
- package/dist/types/compiler/pipeline/remark/admonitions.d.ts +2 -0
- package/dist/types/compiler/pipeline/remark/generic-components.d.ts +6 -0
- package/dist/types/compiler/pipeline/remark/github-alerts.d.ts +2 -0
- package/dist/types/compiler/pipeline/transforms/callout.d.ts +10 -0
- package/dist/types/compiler/pipeline/transforms/code-group.d.ts +3 -0
- package/dist/types/compiler/pipeline/transforms/collapsible.d.ts +3 -0
- package/dist/types/compiler/pipeline/transforms/index.d.ts +6 -0
- package/dist/types/compiler/pipeline/transforms/tabs.d.ts +4 -0
- package/dist/types/compiler/pipeline/transforms/utils.d.ts +6 -0
- package/dist/types/compiler/plugins/builder.d.ts +14 -0
- package/dist/types/compiler/plugins/index.d.ts +3 -0
- package/dist/types/compiler/plugins/loader.d.ts +4 -0
- package/dist/types/compiler/plugins/shared-plugins.d.ts +13 -0
- package/dist/types/compiler/plugins/utils.d.ts +4 -0
- package/dist/types/compiler/safe/compile.d.ts +2 -0
- package/dist/types/compiler/transforms/index.d.ts +1 -0
- package/dist/types/compiler/trusted/compile.d.ts +2 -0
- package/dist/types/compiler/trusted/component-mapper.d.ts +10 -0
- package/dist/types/compiler/trusted/hasDefaultExport.d.ts +2 -0
- package/dist/types/compiler/types/compiler.d.ts +83 -0
- package/dist/types/compiler/types/index.d.ts +3 -0
- package/dist/types/compiler/types/mdx.d.ts +36 -0
- package/dist/types/compiler/types/pipeline.d.ts +54 -0
- package/dist/types/components/base/BaseCallout.d.ts +26 -0
- package/dist/types/components/base/BaseCard.d.ts +11 -0
- package/dist/types/components/base/BaseCodeBlock.d.ts +23 -0
- package/dist/types/components/base/BaseTabs.d.ts +52 -0
- package/dist/types/components/base/CopyButton.d.ts +8 -0
- package/dist/types/components/base/createCollapsible.d.ts +27 -0
- package/dist/types/components/base/createIconComponent.d.ts +6 -0
- package/dist/types/components/base/extractTextContent.d.ts +2 -0
- package/dist/types/components/base/icons.d.ts +50 -0
- package/dist/types/components/base/index.d.ts +12 -0
- package/dist/types/components/base/useCopyToClipboard.d.ts +5 -0
- package/dist/types/components/base/useTabState.d.ts +43 -0
- package/dist/types/components/docusaurus/CodeBlock.d.ts +3 -0
- package/dist/types/components/docusaurus/Details.d.ts +4 -0
- package/dist/types/components/docusaurus/Tabs.d.ts +7 -0
- package/dist/types/components/docusaurus/index.d.ts +3 -0
- package/dist/types/components/generic/Callout.d.ts +8 -0
- package/dist/types/components/generic/CodeGroup.d.ts +4 -0
- package/dist/types/components/generic/Collapsible.d.ts +4 -0
- package/dist/types/components/generic/TabItem.d.ts +6 -0
- package/dist/types/components/generic/Tabs.d.ts +6 -0
- package/dist/types/components/generic/index.d.ts +6 -0
- package/dist/types/components/generic/types.d.ts +19 -0
- package/dist/types/components/index.d.ts +7 -0
- package/dist/types/components/internal/clipboard.d.ts +1 -0
- package/dist/types/components/internal/cn.d.ts +1 -0
- package/dist/types/components/internal/constants.d.ts +1 -0
- package/dist/types/components/nextjs/Image.d.ts +25 -0
- package/dist/types/components/nextjs/Link.d.ts +19 -0
- package/dist/types/components/nextjs/index.d.ts +2 -0
- package/dist/types/components/nextra/Bleed.d.ts +17 -0
- package/dist/types/components/nextra/Callout.d.ts +10 -0
- package/dist/types/components/nextra/Cards.d.ts +18 -0
- package/dist/types/components/nextra/FileTree.d.ts +4 -0
- package/dist/types/components/nextra/Steps.d.ts +4 -0
- package/dist/types/components/nextra/Tabs.d.ts +21 -0
- package/dist/types/components/nextra/createNextraWrapper.d.ts +14 -0
- package/dist/types/components/nextra/index.d.ts +6 -0
- package/dist/types/components/registry/index.d.ts +4 -0
- package/dist/types/components/registry/queries.d.ts +11 -0
- package/dist/types/components/registry/registry-data.d.ts +303 -0
- package/dist/types/components/registry/shim-config.d.ts +18 -0
- package/dist/types/components/registry/types.d.ts +25 -0
- package/dist/types/components/starlight/Aside.d.ts +6 -0
- package/dist/types/components/starlight/Badge.d.ts +9 -0
- package/dist/types/components/starlight/Card.d.ts +8 -0
- package/dist/types/components/starlight/CardGrid.d.ts +7 -0
- package/dist/types/components/starlight/Code.d.ts +11 -0
- package/dist/types/components/starlight/FileTree.d.ts +6 -0
- package/dist/types/components/starlight/LinkCard.d.ts +8 -0
- package/dist/types/components/starlight/Steps.d.ts +6 -0
- package/dist/types/components/starlight/Tabs.d.ts +2 -0
- package/dist/types/components/starlight/index.d.ts +9 -0
- package/dist/types/internal/callout.d.ts +7 -0
- package/dist/types/internal/errors.d.ts +3 -0
- package/dist/types/internal/icons.d.ts +50 -0
- package/package.json +150 -0
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import React, { ReactNode, Context, HTMLAttributes } from 'react';
|
|
2
|
+
import { type TabDefinition, type TabItemProps } from './useTabState';
|
|
3
|
+
export interface BaseTabsConfig {
|
|
4
|
+
classPrefix: string;
|
|
5
|
+
wrapperClass?: string;
|
|
6
|
+
supportsGroupId?: boolean;
|
|
7
|
+
tabItemClassName?: string;
|
|
8
|
+
contextName: string;
|
|
9
|
+
}
|
|
10
|
+
export interface BaseTabsProps {
|
|
11
|
+
children: ReactNode;
|
|
12
|
+
defaultValue?: string;
|
|
13
|
+
values?: TabDefinition[];
|
|
14
|
+
className?: string;
|
|
15
|
+
groupId?: string;
|
|
16
|
+
queryString?: string | boolean;
|
|
17
|
+
lazy?: boolean;
|
|
18
|
+
}
|
|
19
|
+
export interface CreateTabsResult {
|
|
20
|
+
Tabs: React.FC<BaseTabsProps>;
|
|
21
|
+
TabItem: React.FC<TabItemProps>;
|
|
22
|
+
useTabsContext: () => boolean;
|
|
23
|
+
TabsContext: Context<boolean>;
|
|
24
|
+
}
|
|
25
|
+
export declare function createTabs(config: BaseTabsConfig): CreateTabsResult;
|
|
26
|
+
export interface IndexTabsConfig {
|
|
27
|
+
classPrefix: string;
|
|
28
|
+
contextName: string;
|
|
29
|
+
}
|
|
30
|
+
export interface IndexTabsProps<T> extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange'> {
|
|
31
|
+
children: ReactNode;
|
|
32
|
+
items: T[];
|
|
33
|
+
defaultIndex?: number;
|
|
34
|
+
selectedIndex?: number;
|
|
35
|
+
storageKey?: string;
|
|
36
|
+
onChange?: (index: number) => void;
|
|
37
|
+
tabClassName?: string | ((index: number, selected: boolean) => string);
|
|
38
|
+
}
|
|
39
|
+
export interface IndexTabsItemAccessors<T> {
|
|
40
|
+
getLabel: (item: T) => string;
|
|
41
|
+
isDisabled?: (item: T) => boolean;
|
|
42
|
+
}
|
|
43
|
+
export interface CreateIndexTabsResult<T> {
|
|
44
|
+
Tabs: React.FC<IndexTabsProps<T>> & {
|
|
45
|
+
Tab: React.FC<{
|
|
46
|
+
children: ReactNode;
|
|
47
|
+
}>;
|
|
48
|
+
};
|
|
49
|
+
TabsContext: Context<boolean>;
|
|
50
|
+
}
|
|
51
|
+
export declare function createIndexTabs<T>(config: IndexTabsConfig, accessors: IndexTabsItemAccessors<T>): CreateIndexTabsResult<T>;
|
|
52
|
+
export type { TabDefinition, TabItemProps };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
export interface CopyButtonProps {
|
|
3
|
+
text: string;
|
|
4
|
+
className?: string;
|
|
5
|
+
copiedClassName?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function CopyButton({ text, className, copiedClassName, }: CopyButtonProps): ReactElement;
|
|
8
|
+
export default CopyButton;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
export interface CollapsibleClassNames {
|
|
3
|
+
container: string;
|
|
4
|
+
summary: string;
|
|
5
|
+
icon: string;
|
|
6
|
+
iconOpen: string;
|
|
7
|
+
title: string;
|
|
8
|
+
content: string;
|
|
9
|
+
}
|
|
10
|
+
export interface CollapsibleConfig {
|
|
11
|
+
classNames: CollapsibleClassNames;
|
|
12
|
+
iconSize?: number;
|
|
13
|
+
useNativeToggle?: boolean;
|
|
14
|
+
applyOpenClassToWrapper?: boolean;
|
|
15
|
+
defaultSummary?: string;
|
|
16
|
+
}
|
|
17
|
+
export interface BaseCollapsibleProps {
|
|
18
|
+
children: ReactNode;
|
|
19
|
+
summary?: ReactNode;
|
|
20
|
+
title?: ReactNode;
|
|
21
|
+
defaultOpen?: boolean;
|
|
22
|
+
open?: boolean;
|
|
23
|
+
className?: string;
|
|
24
|
+
}
|
|
25
|
+
export declare const GENERIC_COLLAPSIBLE_CLASSES: CollapsibleClassNames;
|
|
26
|
+
export declare const DOCUSAURUS_DETAILS_CLASSES: CollapsibleClassNames;
|
|
27
|
+
export declare function createCollapsible(config: CollapsibleConfig): React.FC<BaseCollapsibleProps>;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import React, { ReactElement } from 'react';
|
|
2
|
+
import { type IconProps } from './createIconComponent';
|
|
3
|
+
export type { IconProps } from './createIconComponent';
|
|
4
|
+
export declare const CALLOUT_ICONS: {
|
|
5
|
+
readonly note: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><circle cx=\"12\" cy=\"12\" r=\"10\"></circle><line x1=\"12\" y1=\"16\" x2=\"12\" y2=\"12\"></line><line x1=\"12\" y1=\"8\" x2=\"12.01\" y2=\"8\"></line></svg>";
|
|
6
|
+
readonly info: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><circle cx=\"12\" cy=\"12\" r=\"10\"></circle><line x1=\"12\" y1=\"16\" x2=\"12\" y2=\"12\"></line><line x1=\"12\" y1=\"8\" x2=\"12.01\" y2=\"8\"></line></svg>";
|
|
7
|
+
readonly tip: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M9 18h6\"></path><path d=\"M10 22h4\"></path><path d=\"M15.09 14c.18-.98.65-1.74 1.41-2.5A4.65 4.65 0 0 0 18 8 6 6 0 0 0 6 8c0 1 .23 2.23 1.5 3.5A4.61 4.61 0 0 1 8.91 14\"></path></svg>";
|
|
8
|
+
readonly warning: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z\"></path><line x1=\"12\" y1=\"9\" x2=\"12\" y2=\"13\"></line><line x1=\"12\" y1=\"17\" x2=\"12.01\" y2=\"17\"></line></svg>";
|
|
9
|
+
readonly caution: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z\"></path><line x1=\"12\" y1=\"9\" x2=\"12\" y2=\"13\"></line><line x1=\"12\" y1=\"17\" x2=\"12.01\" y2=\"17\"></line></svg>";
|
|
10
|
+
readonly danger: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><polygon points=\"7.86 2 16.14 2 22 7.86 22 16.14 16.14 22 7.86 22 2 16.14 2 7.86 7.86 2\"></polygon><line x1=\"12\" y1=\"8\" x2=\"12\" y2=\"12\"></line><line x1=\"12\" y1=\"16\" x2=\"12.01\" y2=\"16\"></line></svg>";
|
|
11
|
+
readonly important: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M22 11.08V12a10 10 0 1 1-5.93-9.14\"></path><polyline points=\"22 4 12 14.01 9 11.01\"></polyline></svg>";
|
|
12
|
+
};
|
|
13
|
+
export declare const FILE_TREE_ICONS: {
|
|
14
|
+
readonly chevron: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><polyline points=\"9 18 15 12 9 6\"></polyline></svg>";
|
|
15
|
+
readonly folder: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z\"></path></svg>";
|
|
16
|
+
readonly file: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z\"></path><polyline points=\"14 2 14 8 20 8\"></polyline></svg>";
|
|
17
|
+
};
|
|
18
|
+
export declare const GITHUB_ICONS: {
|
|
19
|
+
readonly lightbulb: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"currentColor\"><path d=\"M8 1.5c-2.363 0-4 1.69-4 3.75 0 .984.424 1.625.984 2.304l.214.253c.223.264.47.556.673.848.284.411.537.896.621 1.49a.75.75 0 0 1-1.484.211c-.04-.282-.163-.547-.37-.847a8.456 8.456 0 0 0-.542-.68c-.084-.1-.173-.205-.268-.32C3.201 7.75 2.5 6.766 2.5 5.25 2.5 2.31 4.863 0 8 0s5.5 2.31 5.5 5.25c0 1.516-.701 2.5-1.328 3.259-.095.115-.184.22-.268.319-.207.245-.383.453-.541.681-.208.3-.33.565-.37.847a.751.751 0 0 1-1.485-.212c.084-.593.337-1.078.621-1.489.203-.292.45-.584.673-.848.075-.088.147-.173.213-.253.561-.679.985-1.32.985-2.304 0-2.06-1.637-3.75-4-3.75ZM5.75 12h4.5a.75.75 0 0 1 0 1.5h-4.5a.75.75 0 0 1 0-1.5ZM6 15.25a.75.75 0 0 1 .75-.75h2.5a.75.75 0 0 1 0 1.5h-2.5a.75.75 0 0 1-.75-.75Z\"></path></svg>";
|
|
20
|
+
readonly info: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"currentColor\"><path d=\"M0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8Zm8-6.5a6.5 6.5 0 1 0 0 13 6.5 6.5 0 0 0 0-13ZM6.5 7.75A.75.75 0 0 1 7.25 7h1a.75.75 0 0 1 .75.75v2.75h.25a.75.75 0 0 1 0 1.5h-2a.75.75 0 0 1 0-1.5h.25v-2h-.25a.75.75 0 0 1-.75-.75ZM8 6a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z\"></path></svg>";
|
|
21
|
+
readonly warning: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"currentColor\"><path d=\"M6.457 1.047c.659-1.234 2.427-1.234 3.086 0l6.082 11.378A1.75 1.75 0 0 1 14.082 15H1.918a1.75 1.75 0 0 1-1.543-2.575Zm1.763.707a.25.25 0 0 0-.44 0L1.698 13.132a.25.25 0 0 0 .22.368h12.164a.25.25 0 0 0 .22-.368Zm.53 3.996v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 11a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z\"></path></svg>";
|
|
22
|
+
readonly error: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"currentColor\"><path d=\"M4.47.22A.749.749 0 0 1 5 0h6c.199 0 .389.079.53.22l4.25 4.25c.141.14.22.331.22.53v6a.749.749 0 0 1-.22.53l-4.25 4.25A.749.749 0 0 1 11 16H5a.749.749 0 0 1-.53-.22L.22 11.53A.749.749 0 0 1 0 11V5c0-.199.079-.389.22-.53Zm.84 1.28L1.5 5.31v5.38l3.81 3.81h5.38l3.81-3.81V5.31L10.69 1.5ZM8 4a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 8 4Zm0 8a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z\"></path></svg>";
|
|
23
|
+
readonly important: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"currentColor\"><path d=\"M0 1.75C0 .784.784 0 1.75 0h12.5C15.216 0 16 .784 16 1.75v9.5A1.75 1.75 0 0 1 14.25 13H8.06l-2.573 2.573A1.458 1.458 0 0 1 3 14.543V13H1.75A1.75 1.75 0 0 1 0 11.25Zm1.75-.25a.25.25 0 0 0-.25.25v9.5c0 .138.112.25.25.25h2a.75.75 0 0 1 .75.75v2.19l2.72-2.72a.749.749 0 0 1 .53-.22h6.5a.25.25 0 0 0 .25-.25v-9.5a.25.25 0 0 0-.25-.25Zm7 2.25v2.5a.75.75 0 0 1-1.5 0v-2.5a.75.75 0 0 1 1.5 0ZM9 9a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z\"></path></svg>";
|
|
24
|
+
readonly arrowRight: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"currentColor\"><path fill-rule=\"evenodd\" d=\"M8.22 2.97a.75.75 0 0 1 1.06 0l4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.75.75 0 0 1-1.06-1.06l2.97-2.97H3.75a.75.75 0 0 1 0-1.5h7.44L8.22 4.03a.75.75 0 0 1 0-1.06Z\"></path></svg>";
|
|
25
|
+
readonly copy: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" width=\"14\" height=\"14\" fill=\"currentColor\"><path d=\"M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25Z\"></path><path d=\"M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z\"></path></svg>";
|
|
26
|
+
readonly check: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" width=\"14\" height=\"14\" fill=\"currentColor\"><path d=\"M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0Z\"></path></svg>";
|
|
27
|
+
};
|
|
28
|
+
export declare const LUCIDE_ICONS: {
|
|
29
|
+
readonly arrowRight: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><line x1=\"5\" y1=\"12\" x2=\"19\" y2=\"12\"></line><polyline points=\"12 5 19 12 12 19\"></polyline></svg>";
|
|
30
|
+
readonly copy: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><rect x=\"9\" y=\"9\" width=\"13\" height=\"13\" rx=\"2\" ry=\"2\"></rect><path d=\"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1\"></path></svg>";
|
|
31
|
+
readonly check: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><polyline points=\"20 6 9 17 4 12\"></polyline></svg>";
|
|
32
|
+
};
|
|
33
|
+
export declare const COPY_ICONS: {
|
|
34
|
+
readonly copy: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" width=\"14\" height=\"14\" fill=\"currentColor\"><path d=\"M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25Z\"></path><path d=\"M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25Zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25Z\"></path></svg>";
|
|
35
|
+
readonly check: "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\" width=\"14\" height=\"14\" fill=\"currentColor\"><path d=\"M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0Z\"></path></svg>";
|
|
36
|
+
};
|
|
37
|
+
export declare const ChevronIcon: React.FC<IconProps>;
|
|
38
|
+
export declare const LightbulbIcon: React.FC<IconProps>;
|
|
39
|
+
export declare const InfoIconGitHub: React.FC<IconProps>;
|
|
40
|
+
export declare const WarningIconGitHub: React.FC<IconProps>;
|
|
41
|
+
export declare const ErrorIconGitHub: React.FC<IconProps>;
|
|
42
|
+
export declare const ImportantIconGitHub: React.FC<IconProps>;
|
|
43
|
+
export interface ArrowIconProps extends IconProps {
|
|
44
|
+
variant?: 'lucide' | 'github';
|
|
45
|
+
}
|
|
46
|
+
export declare function ArrowIcon({ size, className, variant, }: ArrowIconProps): ReactElement;
|
|
47
|
+
export declare const CopyIcon: React.FC<IconProps>;
|
|
48
|
+
export declare const CheckIcon: React.FC<IconProps>;
|
|
49
|
+
export type NextraCalloutType = 'default' | 'info' | 'warning' | 'error' | 'important';
|
|
50
|
+
export declare const NEXTRA_CALLOUT_ICONS: Record<NextraCalloutType, React.FC<IconProps>>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export { useTabState, extractTabItems, type TabItem, type TabDefinition, type TabItemProps, type UseTabStateOptions, type UseTabStateResult, } from './useTabState';
|
|
2
|
+
export { createTabs, type BaseTabsConfig, type BaseTabsProps, type CreateTabsResult, } from './BaseTabs';
|
|
3
|
+
export { BaseCard, type BaseCardProps } from './BaseCard';
|
|
4
|
+
export { ArrowIcon } from './icons';
|
|
5
|
+
export { useCopyToClipboard, type UseCopyToClipboardResult, } from './useCopyToClipboard';
|
|
6
|
+
export { extractTextContent } from './extractTextContent';
|
|
7
|
+
export { CopyButton, type CopyButtonProps } from './CopyButton';
|
|
8
|
+
export { CALLOUT_ICONS, FILE_TREE_ICONS } from './icons';
|
|
9
|
+
export { createCallout, type BaseCalloutConfig, type BaseCalloutProps, type IconSource, } from './BaseCallout';
|
|
10
|
+
export { createCodeBlock, type BaseCodeBlockProps } from './BaseCodeBlock';
|
|
11
|
+
export { createCollapsible, GENERIC_COLLAPSIBLE_CLASSES, DOCUSAURUS_DETAILS_CLASSES, type CollapsibleConfig, type CollapsibleClassNames, type BaseCollapsibleProps, } from './createCollapsible';
|
|
12
|
+
export { normalizeCalloutType, type CalloutType } from '../generic/types';
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface TabItem {
|
|
3
|
+
value: string;
|
|
4
|
+
label: string;
|
|
5
|
+
content: ReactNode;
|
|
6
|
+
}
|
|
7
|
+
export interface TabDefinition {
|
|
8
|
+
value: string;
|
|
9
|
+
label: string;
|
|
10
|
+
}
|
|
11
|
+
export interface TabItemProps {
|
|
12
|
+
children: ReactNode;
|
|
13
|
+
value?: string;
|
|
14
|
+
label?: string;
|
|
15
|
+
default?: boolean;
|
|
16
|
+
}
|
|
17
|
+
export interface UseTabStateOptions {
|
|
18
|
+
children: ReactNode;
|
|
19
|
+
defaultValue?: string;
|
|
20
|
+
values?: TabDefinition[];
|
|
21
|
+
}
|
|
22
|
+
export interface UseTabStateResult {
|
|
23
|
+
activeValue: string;
|
|
24
|
+
setActiveValue: (value: string) => void;
|
|
25
|
+
tabs: TabDefinition[];
|
|
26
|
+
tabItems: TabItem[];
|
|
27
|
+
}
|
|
28
|
+
export declare function extractTabItems(children: ReactNode): TabItem[];
|
|
29
|
+
export declare function useTabState(options: UseTabStateOptions): UseTabStateResult;
|
|
30
|
+
export default useTabState;
|
|
31
|
+
export interface UseIndexTabsOptions<T> {
|
|
32
|
+
items: T[];
|
|
33
|
+
defaultIndex?: number;
|
|
34
|
+
controlledIndex?: number;
|
|
35
|
+
storageKey?: string;
|
|
36
|
+
onChange?: (index: number) => void;
|
|
37
|
+
isDisabled?: (item: T, index: number) => boolean;
|
|
38
|
+
}
|
|
39
|
+
export interface UseIndexTabsResult {
|
|
40
|
+
activeIndex: number;
|
|
41
|
+
setActiveIndex: (index: number) => void;
|
|
42
|
+
}
|
|
43
|
+
export declare function useIndexTabs<T>({ items, defaultIndex, controlledIndex, storageKey, onChange, isDisabled, }: UseIndexTabsOptions<T>): UseIndexTabsResult;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type BaseTabsProps, type TabDefinition, type TabItemProps as BaseTabItemProps } from '../base';
|
|
2
|
+
export type TabsProps = BaseTabsProps;
|
|
3
|
+
export type TabItemProps = BaseTabItemProps;
|
|
4
|
+
export type { TabDefinition };
|
|
5
|
+
declare const Tabs: import("react").FC<BaseTabsProps>, TabItem: import("react").FC<BaseTabItemProps>, useTabsContext: () => boolean, TabsContext: import("react").Context<boolean>;
|
|
6
|
+
export { Tabs, TabItem, useTabsContext, TabsContext };
|
|
7
|
+
export default Tabs;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ReactElement } from 'react';
|
|
2
|
+
import { type BaseCalloutProps } from '../base/BaseCallout';
|
|
3
|
+
import { CalloutType } from './types';
|
|
4
|
+
export type CalloutProps = BaseCalloutProps<CalloutType>;
|
|
5
|
+
export declare function Callout(props: CalloutProps): ReactElement;
|
|
6
|
+
export declare function Alert(props: CalloutProps): ReactElement;
|
|
7
|
+
export declare function Admonition(props: CalloutProps): ReactElement;
|
|
8
|
+
export default Callout;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { CollapsibleProps } from './types';
|
|
2
|
+
export declare function Collapsible(props: CollapsibleProps): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export declare function Accordion(props: CollapsibleProps): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export default Collapsible;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type BaseTabsProps, type TabDefinition } from '../base';
|
|
2
|
+
export type TabsProps = BaseTabsProps;
|
|
3
|
+
export type { TabDefinition };
|
|
4
|
+
declare const Tabs: import("react").FC<BaseTabsProps>, TabItem: import("react").FC<import("../base").TabItemProps>, useGenericTabsContext: () => boolean, GenericTabsContext: import("react").Context<boolean>;
|
|
5
|
+
export { Tabs, TabItem, useGenericTabsContext, GenericTabsContext };
|
|
6
|
+
export default Tabs;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { normalizeCalloutType, CALLOUT_TITLES, type CalloutType, type CalloutProps, type CollapsibleProps, type CodeGroupProps, } from './types';
|
|
2
|
+
export { Callout, Alert, Admonition } from './Callout';
|
|
3
|
+
export { Collapsible, Accordion } from './Collapsible';
|
|
4
|
+
export { Tabs, useGenericTabsContext, type TabsProps } from './Tabs';
|
|
5
|
+
export { TabItem, Tab } from './TabItem';
|
|
6
|
+
export { CodeGroup } from './CodeGroup';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import { type CalloutType, normalizeCalloutType, CALLOUT_TITLES } from '../../internal/callout';
|
|
3
|
+
export { type CalloutType, normalizeCalloutType, CALLOUT_TITLES };
|
|
4
|
+
export interface CalloutProps {
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
type?: CalloutType;
|
|
7
|
+
title?: string;
|
|
8
|
+
icon?: ReactNode;
|
|
9
|
+
}
|
|
10
|
+
export interface CollapsibleProps {
|
|
11
|
+
children: ReactNode;
|
|
12
|
+
title: string;
|
|
13
|
+
defaultOpen?: boolean;
|
|
14
|
+
summary?: string;
|
|
15
|
+
}
|
|
16
|
+
export interface CodeGroupProps {
|
|
17
|
+
children: ReactNode;
|
|
18
|
+
labels?: string[];
|
|
19
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { createTabs, createIndexTabs, type BaseTabsConfig, type BaseTabsProps, type CreateTabsResult, } from './base/BaseTabs';
|
|
2
|
+
export { createCallout, type BaseCalloutConfig, type BaseCalloutProps, type IconSource, } from './base/BaseCallout';
|
|
3
|
+
export { createCollapsible, type CollapsibleConfig, type BaseCollapsibleProps, } from './base/createCollapsible';
|
|
4
|
+
export { createCodeBlock, type BaseCodeBlockProps } from './base/BaseCodeBlock';
|
|
5
|
+
export { BaseCard, type BaseCardProps } from './base/BaseCard';
|
|
6
|
+
export { CopyButton, type CopyButtonProps } from './base/CopyButton';
|
|
7
|
+
export { createIconComponent, type IconProps, } from './base/createIconComponent';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function copyToClipboard(text: string): Promise<boolean>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function cn(...classes: (string | false | null | undefined)[]): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const CODE_COPY_FEEDBACK_DURATION_MS = 2000;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ImgHTMLAttributes } from 'react';
|
|
2
|
+
export interface ImageProps extends Omit<ImgHTMLAttributes<HTMLImageElement>, 'src' | 'srcSet' | 'ref' | 'width' | 'height' | 'loading'> {
|
|
3
|
+
src: string | {
|
|
4
|
+
src: string;
|
|
5
|
+
height?: number;
|
|
6
|
+
width?: number;
|
|
7
|
+
};
|
|
8
|
+
alt: string;
|
|
9
|
+
width?: number | string;
|
|
10
|
+
height?: number | string;
|
|
11
|
+
fill?: boolean;
|
|
12
|
+
quality?: number;
|
|
13
|
+
priority?: boolean;
|
|
14
|
+
placeholder?: 'blur' | 'empty';
|
|
15
|
+
blurDataURL?: string;
|
|
16
|
+
loader?: (props: {
|
|
17
|
+
src: string;
|
|
18
|
+
width: number;
|
|
19
|
+
quality?: number;
|
|
20
|
+
}) => string;
|
|
21
|
+
unoptimized?: boolean;
|
|
22
|
+
sizes?: string;
|
|
23
|
+
}
|
|
24
|
+
export declare function Image({ src, alt, width, height, fill, priority, placeholder, blurDataURL, loader: _loader, unoptimized: _unoptimized, quality: _quality, sizes: _sizes, className, style, ...rest }: ImageProps): import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
export default Image;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { AnchorHTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export interface LinkProps extends Omit<AnchorHTMLAttributes<HTMLAnchorElement>, 'href'> {
|
|
3
|
+
href: string | {
|
|
4
|
+
pathname?: string;
|
|
5
|
+
query?: Record<string, string>;
|
|
6
|
+
hash?: string;
|
|
7
|
+
};
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
as?: string;
|
|
10
|
+
replace?: boolean;
|
|
11
|
+
scroll?: boolean;
|
|
12
|
+
shallow?: boolean;
|
|
13
|
+
passHref?: boolean;
|
|
14
|
+
prefetch?: boolean;
|
|
15
|
+
locale?: string | false;
|
|
16
|
+
legacyBehavior?: boolean;
|
|
17
|
+
}
|
|
18
|
+
export declare function Link({ href, children, as: _as, replace: _replace, scroll: _scroll, shallow: _shallow, passHref: _passHref, prefetch: _prefetch, locale: _locale, legacyBehavior: _legacyBehavior, className, ...rest }: LinkProps): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export default Link;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ReactNode, ReactElement, HTMLAttributes } from 'react';
|
|
2
|
+
type TextSize = 'sm' | 'base' | 'lg' | 'xl';
|
|
3
|
+
type FontWeight = 'normal' | 'medium' | 'semibold' | 'bold';
|
|
4
|
+
type HAlign = 'left' | 'center' | 'right';
|
|
5
|
+
type VAlign = 'top' | 'middle' | 'bottom';
|
|
6
|
+
type HeightPreset = 'sm' | 'md' | 'lg' | 'xl' | 'screen' | 'half';
|
|
7
|
+
export interface BleedProps extends HTMLAttributes<HTMLDivElement> {
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
size?: TextSize;
|
|
10
|
+
weight?: FontWeight;
|
|
11
|
+
italic?: boolean;
|
|
12
|
+
align?: HAlign;
|
|
13
|
+
valign?: VAlign;
|
|
14
|
+
height?: HeightPreset;
|
|
15
|
+
}
|
|
16
|
+
export declare function Bleed({ children, size, weight, italic, align, valign, height, className, ...props }: BleedProps): ReactElement;
|
|
17
|
+
export default Bleed;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ReactNode, ReactElement, HTMLAttributes } from 'react';
|
|
2
|
+
import { type NextraCalloutType } from '../base/icons';
|
|
3
|
+
export type CalloutType = NextraCalloutType | null;
|
|
4
|
+
export interface CalloutProps extends HTMLAttributes<HTMLDivElement> {
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
type?: CalloutType;
|
|
7
|
+
emoji?: ReactNode;
|
|
8
|
+
}
|
|
9
|
+
export declare function Callout({ children, type, emoji, className, ...props }: CalloutProps): ReactElement;
|
|
10
|
+
export default Callout;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ReactNode, ReactElement, HTMLAttributes } from 'react';
|
|
2
|
+
export interface CardsProps extends HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
num?: number;
|
|
5
|
+
}
|
|
6
|
+
export interface CardProps extends HTMLAttributes<HTMLAnchorElement | HTMLDivElement> {
|
|
7
|
+
children?: ReactNode;
|
|
8
|
+
icon?: ReactNode;
|
|
9
|
+
title: string;
|
|
10
|
+
href?: string;
|
|
11
|
+
arrow?: boolean;
|
|
12
|
+
}
|
|
13
|
+
declare function CardsComponent({ children, num, className, style, ...props }: CardsProps): ReactElement;
|
|
14
|
+
declare function Card({ children, icon, title, href, arrow, className, ...props }: CardProps): ReactElement;
|
|
15
|
+
export declare const Cards: typeof CardsComponent & {
|
|
16
|
+
Card: typeof Card;
|
|
17
|
+
};
|
|
18
|
+
export default Cards;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { type IndexTabsProps } from '../base/BaseTabs';
|
|
3
|
+
export type TabItem = string | {
|
|
4
|
+
label: string;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
};
|
|
7
|
+
declare const TabsContext: import("react").Context<boolean>;
|
|
8
|
+
export type TabsProps = IndexTabsProps<TabItem>;
|
|
9
|
+
export interface TabProps {
|
|
10
|
+
children: ReactNode;
|
|
11
|
+
}
|
|
12
|
+
export declare const Tab: import("react").FC<{
|
|
13
|
+
children: ReactNode;
|
|
14
|
+
}>;
|
|
15
|
+
export declare const Tabs: import("react").FC<IndexTabsProps<TabItem>> & {
|
|
16
|
+
Tab: React.FC<{
|
|
17
|
+
children: ReactNode;
|
|
18
|
+
}>;
|
|
19
|
+
};
|
|
20
|
+
export { TabsContext };
|
|
21
|
+
export default Tabs;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React, { ReactNode, HTMLAttributes, ComponentType } from 'react';
|
|
2
|
+
type WrapperChildProps = {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
};
|
|
5
|
+
export interface NextraWrapperConfig {
|
|
6
|
+
StarlightComponent: ComponentType<WrapperChildProps>;
|
|
7
|
+
wrapperClassName: string;
|
|
8
|
+
displayName: string;
|
|
9
|
+
}
|
|
10
|
+
export type NextraWrapperProps = HTMLAttributes<HTMLDivElement> & {
|
|
11
|
+
children: ReactNode;
|
|
12
|
+
};
|
|
13
|
+
export declare function createNextraWrapper(config: NextraWrapperConfig): React.FC<NextraWrapperProps>;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { Callout, type CalloutProps, type CalloutType } from './Callout';
|
|
2
|
+
export { Tabs, type TabsProps, type TabProps, type TabItem } from './Tabs';
|
|
3
|
+
export { Cards, type CardsProps, type CardProps } from './Cards';
|
|
4
|
+
export { FileTree, type FileTreeProps } from './FileTree';
|
|
5
|
+
export { Steps, type StepsProps } from './Steps';
|
|
6
|
+
export { Bleed, type BleedProps } from './Bleed';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type GenericComponentName } from './registry-data';
|
|
2
|
+
import { type Framework } from './types';
|
|
3
|
+
export declare function getAllGenericComponentNames(): string[];
|
|
4
|
+
export declare function getGenericComponentSet(): Set<string>;
|
|
5
|
+
export declare function getPrimaryGenericComponentNames(): GenericComponentName[];
|
|
6
|
+
export declare function getCanonicalComponentName(nameOrAlias: string): string | undefined;
|
|
7
|
+
export declare function getFrameworkComponents<F extends Framework>(framework: F): readonly string[];
|
|
8
|
+
export declare function isGenericComponent(name: string): boolean;
|
|
9
|
+
export declare function isFrameworkComponent(name: string, framework?: Framework): boolean;
|
|
10
|
+
export declare function getGenericShimPath(componentName: string): string;
|
|
11
|
+
export declare function getFrameworkShimPath(framework: Framework, componentName: string): string;
|