@storybook/react-native-ui
Version:
ui components for react native storybook
117 lines (110 loc) • 4.36 kB
TypeScript
import * as _storybook_react_native_theming from '@storybook/react-native-theming';
import * as react_native from 'react-native';
import { View } from 'react-native';
import React, { FC, ComponentProps, ReactNode } from 'react';
import { State, StoriesHash } from 'storybook/internal/manager-api';
import { Item, ExpandAction, CombinedDataset, Selection, SBUI } from '@storybook/react-native-ui-common';
import { API_LoadedRefData, API_IndexHash } from 'storybook/internal/types';
import * as react_jsx_runtime from 'react/jsx-runtime';
import { StoryContext, Args } from 'storybook/internal/csf';
import { ReactRenderer } from '@storybook/react';
interface NodeProps$1 {
children: React.ReactNode | React.ReactNode[];
isExpandable?: boolean;
isExpanded?: boolean;
}
declare const BranchNode: _storybook_react_native_theming.StyledComponent<react_native.TouchableOpacityProps & React.RefAttributes<View> & {
theme?: _storybook_react_native_theming.Theme;
as?: React.ElementType;
} & {
depth?: number;
isExpandable?: boolean;
isExpanded?: boolean;
isComponent?: boolean;
isSelected?: boolean;
}, {}, {
ref?: React.Ref<any>;
}>;
declare const GroupNode: FC<ComponentProps<typeof BranchNode> & {
isExpanded?: boolean;
isExpandable?: boolean;
}>;
declare const ComponentNode: FC<ComponentProps<typeof BranchNode>>;
declare const StoryNode: React.NamedExoticComponent<Omit<react_native.TouchableOpacityProps & React.RefAttributes<View> & {
theme?: _storybook_react_native_theming.Theme;
as?: React.ElementType;
} & {
depth?: number;
selected?: boolean;
} & {
ref?: React.Ref<any>;
}, "ref"> & React.RefAttributes<View>>;
interface NodeProps {
item: Item;
refId: string;
docsMode: boolean;
isOrphan: boolean;
isDisplayed: boolean;
color: string | undefined;
isSelected: boolean;
isFullyExpanded?: boolean;
isExpanded: boolean;
setExpanded: (action: ExpandAction) => void;
setFullyExpanded?: () => void;
onSelectStoryId: (itemId: string) => void;
status: State['status'][keyof State['status']];
}
declare const Node: React.NamedExoticComponent<NodeProps>;
declare const LeafNodeStyleWrapper: _storybook_react_native_theming.StyledComponent<react_native.ViewProps & {
theme?: _storybook_react_native_theming.Theme;
as?: React.ElementType;
}, {}, {
ref?: React.Ref<View>;
}>;
declare const RootNode: _storybook_react_native_theming.StyledComponent<react_native.ViewProps & {
theme?: _storybook_react_native_theming.Theme;
as?: React.ElementType;
}, {}, {
ref?: React.Ref<View>;
}>;
declare const RootNodeText: _storybook_react_native_theming.StyledComponent<react_native.TextProps & {
theme?: _storybook_react_native_theming.Theme;
as?: React.ElementType;
}, {}, {
ref?: React.Ref<react_native.Text>;
}>;
declare const Tree: React.NamedExoticComponent<{
isBrowsing: boolean;
isMain: boolean;
status?: State["status"];
refId: string;
data: StoriesHash;
docsMode: boolean;
selectedStoryId: string | null;
onSelectStoryId: (storyId: string) => void;
}>;
interface ExplorerProps {
isLoading: boolean;
isBrowsing: boolean;
dataset: CombinedDataset;
selected: Selection;
setSelection: (selection: Selection) => void;
}
declare const Explorer: FC<ExplorerProps>;
declare const useCombination: (index: SidebarProps["index"], indexError: SidebarProps["indexError"], previewInitialized: SidebarProps["previewInitialized"], status: SidebarProps["status"], refs: SidebarProps["refs"]) => CombinedDataset;
interface SidebarProps extends API_LoadedRefData {
refs: State['refs'];
status: State['status'];
storyId?: string;
refId?: string;
menuHighlighted?: boolean;
setSelection: (selection: Selection) => void;
}
declare const Sidebar: React.NamedExoticComponent<SidebarProps>;
declare const FullUI: SBUI;
declare const Layout: ({ storyHash, story, children, }: {
storyHash: API_IndexHash | undefined;
story?: StoryContext<ReactRenderer, Args>;
children: ReactNode | ReactNode[];
}) => react_jsx_runtime.JSX.Element;
export { ComponentNode, Explorer, ExplorerProps, FullUI, GroupNode, Layout, LeafNodeStyleWrapper, Node, NodeProps$1 as NodeProps, RootNode, RootNodeText, Sidebar, SidebarProps, StoryNode, Tree, useCombination };